Monday, April 7, 2008

Types of DNS records

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: 3.2.0.192.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.

No comments:

Post a Comment