Code: Select all
$TTL 3600
@ IN MX 5 mail
@ IN NS ns1.w3style.co.uk.
@ IN NS ns2.w3style.co.uk.
@ IN A 217.147.94.70
;Yes yes I know but it helps ATM
localhost IN A 127.0.0.1
;Servers etc
www IN A 217.147.94.70
mail IN A 217.147.94.70
ftp IN CNAME www
smtp IN A 217.147.94.117
Other machines will cache your server's response. TTL is time-to-leave and tells remote machines how long to hold cached data for. It's 1 hour here. Some people have this at 1 day or whatever. Don't set it too low if you're runnng DNS for a busy site as you will want to keep the number of reuests as low as you can.
Code: Select all
@ IN SOA ns1.w3style.co.uk. admin.w3style.co.uk. (
2005121907 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; default_ttl
)
Note, in zone files, if you want to give a domain name you need to add a dot at the end. If I want to put
http://www.google.com in a zone file I need to write it "
www.google.com.". The reason for that is that without the dot, it assumes that you're referring to a subdomain - so if the zone file is for swiftmailer.org it would look for
http://www.google.com.swiftmailer.org without that trailing dot.
The @ sign means that the line which follows applies to the base domain (so here, in named.conf it was defined as swiftmailer.org, so the @ basically means "swiftmailer.org"). IN is the keyword you use to specify which type of record you're defined (i.e. IN A, IN CNAME, IN MX...).
SOA is start-of-authority. It's basically the machine that hold the authoritive information for the domain (the primary NS). You don't need to put the IP address, and you shouldn't really. The domain name is the thing you should put.
2005121907 ; serial
That's a serial number. It's not crucial. It's basically YYYYMMDDXX where YYYYMMDD is the date of the last update you made to the zone file, and XX is the number of the update you made that day. Obviously I was busy this day! It was my 7th update.
28800 ; refresh
This is like the TTL, except it's only honoured by slave DNS servers.
7200 ; retry
In the event of a problem, retry in 7200 seconds.
604800 ; expire
This is for cahed data and slave DNS servers. Basically, TTL and refresh specify the time durations to get new information from the zone file. But this value here is in the vent that your server has been offline for a long time and the slave DNS server have been unable to refresh their data. They will continue to give out their copy of the data until this time is reached.
86400 ; default_ttl
I actually can't remember what that's there for when TTL is at the top.... it's probably for the slave servers to take note of
Code: Select all
@ IN MX 5 mail
@ IN NS ns1.w3style.co.uk.
@ IN NS ns2.w3style.co.uk.
@ IN A 217.147.94.70
These are where my DNS records start. the @ means they apply to swiftmailer.org and NOT
http://www.swiftmailer.org or anything else. Notice that some have a dot after them, and some don't? The ones that don't end with a dot are expanded to XXXX.swiftmailer.org. IP addresses needn't end with a trailing dot.
Code: Select all
;Yes yes I know but it helps ATM
localhost IN A 127.0.0.1
Ignore this, I'm an idiot, I forgot I left that in there.
Code: Select all
;Servers etc
www IN A 217.147.94.70
mail IN A 217.147.94.70
ftp IN CNAME www
smtp IN A 217.147.94.117
DNS records for subdomains of swiftmailer.org:
http://www.swiftmailer.org, mail.swiftmailer.org, ftp.swiftmailer.org etc etc. It should make sense, it's in the same format as those lines starting with @ except we're using subdomains, not the base domain.