PTR (pointer) records are the reverse of A records: whereas the latter maps
names to addresses, PTR addresses map addresses to names. PTR records are
not stored in the main zone database for mydomain.com, but in another
database which covers reverse lookups. There is a special domain set aside
for reverse lookups: in-addr.arpa. PTR records reference addresses with
respect to this zone. In practice, this means that when creating a PTR
record, the numerical address is reversed and followed by "in-addr.arpa."
So the PTR record for the IP address 192.168.40.32 would refer to it as
32.40.168.192.in-addr.arpa.
Thus, the PTR records for the machines listed above would look like this:
40.168.192.in-addr.arpa. IN SOA ns1.mydomain.com. root.mail.mydomain.com. (
2002012901 ; last updated January 29th, once
24h
2h
4w
4d )
31 IN PTR mydomain.com.
32 IN PTR mail.mydomain.com.
33 IN PTR ns1.mydomain.com.
34 IN PTR ns2.mydomain.com.
44 IN PTR cheesebox.mydomain.com.
45 IN PTR lester.mydomain.com.
The last type of DNS record that we'll cover is MX (Mail eXchanger)
records. These address the handling of email. Each record specifies a
machine that should handle the mail for a given domain. When multiple mail
exchangers are listed for a given domain, they can be given rankings in
order of preference. These rankings take the form of a number (from 0 to
65535, with 0 representing the most preferred exchanger) appearing before
the name of the exchanger, so that if the more-preferred machine doesn't
work, the next in line will be tried.
mydomain.com. IN MX 0 mail.mydomain.com.
mydomain.com. IN MX 50 lester.mydomain.com.
That's the gist of DNS records. There are a number of other types of
records for specialized purposes, but the ones we've covered are sufficient
for most needs. There are abbreviated forms and shortcuts that you can use
to save on typing and download times, but those are a little less
transparent to the eye than the long forms.
The whole list of records is placed together in a zone data file, which
looks like this:
$TTL 24h
;
; zone data file
; comments can appear on any line after a semi-colon
;
mydomain.com. IN SOA ns1.mydomain.com. root.mail.mydomain.com. (
2002012901 ; last updated January 29th, once
24h
2h
4w
4d )
mydomain.com. IN NS ns1.mydomain.com.
mydomain.com. IN NS ns2.mydomain.com.
mydomain.com. IN A 192.168.40.31
mail.mydomain.com. IN A 192.168.40.32
ns1.mydomain.com. IN A 192.168.40.33
ns2.mydomain.com. IN A 192.168.40.34
cheesebox.mydomain.com. IN A 192.168.148.44
lester.mydomain.com. IN A 192.168.148.45
www.mydomain.com. IN CNAME mydomain.com.
wwww.mydomain.com. IN CNAME mydomain.com.
ww.mydomain.com. IN CNAME mydomain.com.
cb.mydomain.com. IN CNAME cheesebox.mydomain.com.
mydomain.com. IN MX 0 mail.mydomain.com.
mydomain.com. IN MX 50 lester.mydomain.com.
Notice that $TTL 24h at the top. That means that the file's Time To Live is
24 hours. This file is placed on the name server machines. That sort of falls into
the Setup topic, which we'll cover next.
next page»