Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Absolute BSD - The Ultimate Guide To FreeBSD (2002).pdf
Скачиваний:
26
Добавлен:
17.08.2013
Размер:
8.15 Mб
Скачать

Host Records

Lastly, we have the actual host records (z), the meat of the zone file. We're concerned with two types of host records: CNAME and A records. As we saw in the dig example, a CNAME is a reference to a canonical name, an alias. An A record points a name to an IP address. Our example shows that http://absolutebsd.com/ is an alias for http://www.absolutebsd.com/. (Remember, when there's no name explicitly given for an entry, it defaults to the domain the file represents!) The host http://www.absolutebsd.com/ has an Internet address of 209.69.178.30.

Periods, Termination, and Zone Files

You've already seen (in the section on "Zones Files" describing the SOA record) that periods can be substituted for the @ sign in email addresses when you're creating zone files. Periods are further overloaded, however, into termination symbols for hostnames. When using the @ symbol in this way, named assumes that all hostnames are part of the zone the file is for. There's no need for you to write out "http://www.absolutebsd.com/"; named knows that you're talking about http://absolutebsd.com/, and just saying "www" suffices. (Every hostname has the zone name appended to it.)

This system works well, except when the host isn't part of the domain in question. For example, since the nameservers for http://absolutebsd.com/ are not in that domain, we don't want them showing up as http://blackhelicopters.org.absolutebsd.com/, now do we?

This is where a period comes in. If you put a period after a hostname, named assumes that you've listed the complete hostname, including domain name. As you can see in the preceding examples, every complete hostname after the SOA record has a period after it. Even the CNAME entry pointing t o h t t p : / / w w w . a b s o l u t e b s d . c o m / h a s a p e r i o d ; i f i t d i d n ' t , i t w o u l d d i r e c t u s t o http://www.absolutebsd.com.absolutebsd.com/. When you typed http://www.AbsoluteBSD.com into your Web browser, the browser wouldn't be able to find the page. Instead, you would have to type http://www.absolutebsd.com.absolutebsd.com/. Now that wouldn't be very helpful, would it?[2]

[2]Actually, now that I think of it, having that as an actual hostname would be something that DNS geeks would find funny. Remember that before becoming a DNS geek.

Making Changes Work

So, you have your nameserver configured and your zone files are all set up. We're looking pretty good. But the nameserver won't make the changes until you tell named to reread its configuration files.

To apply your changes, use the name daemon controller, ndc(8). Ndc can handle all named management functions, which will vary with how your named is compiled. For a complete list of all functions, run ndc help as root:

...............................................................................................

# ndc help

(builtin) start − start the server

(builtin) restart − stop server if any, start a new one getpid

status stop exec

reload [zone] ...

reconfig [−noexpired] (just sees new/gone zones)

288