Basic Domain Settings
Basic Settings
To configure basic DNS for a new domain, we will only really need to create two records, after ensuring our nameservers are pointed to the correct location.
If you are just messing around with NGINX or Apache, there is no real need to purchase a domain to simply resolve your IP with DNS. Check out Freenom for a free domain name, granted it may not be your first choice - but they provide a wide range of free domains for up to 12 months.
Nameservers
A nameserver defines the path the DNS will take to resolve your domain name's IP address. If you purchased your domain already, chances are you created an account with the vendor you purchased from. Login to this account, and locate a 'DNS Records / Settings' panel to modify your DNS records using the vendors supplied control panel. If you would rather use another control panel, for example DigitalOcean, you would need to login to your domain provider's control panel and alter your domain's nameservers to reflect the below -
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
This allows your domain to resolve using the appropriate servers on which we have set our DNS records using their respective control panels.
DNS Records
To get started using our new domain, we will only need the below basic DNS settings -
Type | Hostname | Value | TTL |
A | www.website.com | 0.0.0.0 | 3600 |
A | @.website.com | 0.0.0.0 | 3600 |
A | *.website.com | 0.0.0.0 | 3600 |
These basic settings will allow you to further configure DNS on the host directly using a webserver if you so choose, or if you'd rather the interface using the control panel associated with your nameservers is fine as well.
DNS Record Types / Definitions
A Records
An A record maps an IPv4 address to a domain name. This determines where to direct any requests for a domain name.
AAAA Records
An AAAA record, also called a Quad A record, maps an IPv6 address to a domain name. This determines where to direct requests for a domain name in the same way that an A record does for IPv4 addresses.
CNAME Records
A CNAME record defines an alias for an A record; it points one domain to another domain instead of to an IP address. When the associated A record’s IP address changes, the CNAME will follow to the new address.
MX Records
An MX record specifies the mail servers responsible for accepting email on behalf of your domain. Providers often make multiple name servers available so that if one is offline, another can respond. Each server needs its own MX record.
NS Records
An NS record specifies the name servers, or servers that provide DNS services, for a domain or subdomain. You can use these to direct part of your traffic to another DNS service or to delegate DNS administration for a subdomain.