What is DNS (Domain Name System)?
Machines on the Internet are identified by numerical “IP addresses” like 192.0.2.1. Domain names make it possible to refer to machines by a name rather than a number. The Domain Name Sytem makes it possible to map domain names to IP addresses. DNS is a lightweight protocol that makes it easy to look up information on domain names.
A domain name is made up from a set of labels, joined together with periods (‘.’). Domains exist within a hierarchy. The right most label indicates the broad type level domain, such as .au (Australia), .com (global commercial), etc. To the left of this is the second level domain. For global top level domains, it is possible to register domains at the second level (eg. apple.com). In Australia domains are registered under one of several second level domains like .com.au (commercial), .org.au (non-profit), .id.au (individual), etc.
Registering a domain
Companies that allow you to licence a domain name are called registrars. For global top level domains (.com, .org, .net, .info, etc.) there are many registrars to choose from. A list is available from http://www.internic.net/
Likewise, there are several registrars in Australia who can provide domain names under one of the open second level domains (.com.au, .net.au, .org.au, .asn.au, .id.au). A list is available from http://www.ausregistry.net/ or from auDA, the organisation that manages the .au domain name space.
AAPT can register Australian domain names on your behalf and provide DNS hosting/management too. AAPT registers domains through well known registrar Melbourne IT. If you register a domain yourself, you will need to specify which nameservers will be used to host it. If domain is managed by AAPT, the nameservers will be yarrina.connect.com.au and warrane.connect.com.au.
Types of DNS records
There are many types of records that can be used in DNS. Here are the most common.
A records – address data
An A record is used to map a hostname to an IP address. This example shows that the IP for mail.example.com is 192.0.2.3
mail.example.com. IN A 192.0.2.3
MX records – mail exchange information
MX records indicate which server or servers are responsible for handling mail for the domain. A numerical priority determines the order in which servers should be used. The server with the lowest priority is the primary. In this example, mail.example.com handles mail, but yarrina.connect.com.au will also accept mail if the primary is down:
example.com. IN MX 10 mail.example.com. example.com. IN MX 100 yarrina.connect.com.au.
NS records – delegation information
NS records indicate which nameservers are responsible for the domain. In this example, the domain is delegated to AAPT’s nameservers:
example.com. IN NS yarrina.connect.com.au. example.com. IN NS warrane.connect.com.au.
CNAME records – make an alias
If you want a hostname to be an alias for some other domain, you can give it a CNAME record to indicate the real domain that it is aliasing. In this example, server.example is the real domain name, but ftp.example.com. is an alias for it that can also be used:
ftp.example.com. IN CNAME server.example.com.
PTR records – reverse DNS data
Whereas A records map hostnames to IP addresses, PTR records make it possible to start with an IP address and discover which hostname points to it. In this example, 192.0.2.3 maps back to mail.examnple.com, so it matches the A record above:
22.214.171.124.in-addr.arpa. IN PTR mail.example.com.
Note that the IP address is inversed and prepended to “in-addr.arpa.” to make it fit into the DNS.