|I l@ve RuBoard|
2.2 Creating a Zone Data File
Using your favorite editor, create a file in the primary master name server's working directory. Name the file after the zone whose resource records it will contain. For example, for the foo.example zone, you might call the zone data file db.foo.example.
Begin the file with a $TTL control statement. This tells other name servers (not those authoritative for the zone) how long they may cache records from this zone by specifying the zone's default time to live. You can specify the value as an integer number of seconds or as a scaled value: an integer followed by s for seconds, m for minutes, h for hours, d for days or w for weeks. For example, you can specify a time to live of one day with either:
Time to live values between one hour and one day are common.
Next, add an SOA record for the zone. The SOA record contains information about the whole zone, including how often the zone's slave name servers should check to see whether the zone has changed. The SOA record begins with the zone's domain name, a specification of the zone's class (which is almost always IN, for Internet), and the type mnemonic SOA. After the type, the SOA record requires seven fields:
foo.example. IN SOA ns1.foo.example. ( hostmaster.foo.example. 2002040700 1h 15m 30d 1h )
Since we ran out of room for the record on the first line, we ended the line with "(", which tells the name server to treat all text between the "(" and a successive ")" as though it were on a single line. (We could also have just kept typing the whole record on a single line, but that would have been hard to read.)
foo.example. IN NS ns1.foo.example. foo.example. IN NS ns2.foo.example. foo.example. IN NS ns.isp.net.
The domain names in the resource records all end in dots to keep the name server from appending the origin to them. The default origin for a zone data file is just the domain name of the zone, which in this case is foo.example, so we could have written the SOA record as:
@ IN SOA ns1 ( hostmaster 2002040700 1h 15m 30d 1h )
Since these first several resource records in the zone are all attached to the same domain name (foo.example, in our example), you can specify the domain name for just the first of them and begin the rest of the records with whitespace (spaces or tabs):
@ IN SOA ns1 ( hostmaster 2002040700 1h 15m 30d 1h ) IN NS ns1.foo.example. IN NS ns2.foo.example. IN NS ns.isp.net.
The name server interprets records that begin with whitespace as belonging to the most recently specified domain name.
2.2.4 See Also
|I l@ve RuBoard|