I l@ve RuBoard |
2.2 Creating a Zone Data File2.2.1 ProblemYou need to create a data file for a zone. 2.2.2 SolutionUsing 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.[1] 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:
$TTL 86400 or: $TTL 1d You can even concatenate two scaled values, like so: $TTL 1d12h 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:
Here's a sample SOA record for the foo.example zone: 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.) Finally, add NS records listing the domain names of the authoritative name servers for the zone. You probably specified these name servers when you registered your domain name. foo.example. IN NS ns1.foo.example. foo.example. IN NS ns2.foo.example. foo.example. IN NS ns.isp.net. 2.2.3 DiscussionThe 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 ) ("@" is short for "the current origin.") 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 AlsoSection 1.15 for creating a named.conf file, Section 1.16 for configuring a primary master name server, and Chapter 4 of DNS and BIND. |
I l@ve RuBoard |