|
|
||
|
||
|
|
| Red Hat Documentation |
3. A caching only name server.A first stab at DNS config, very useful for dialup users.
A caching only name server will find the answer to name queries and remember the answer the next time you need it. This will shorten the waiting time the next time significantly, especially if you're on a slow connection.
First you need a file called
// Config file for caching only name server
options {
directory "/var/named";
// Uncommenting this might help if you have to go through a
// firewall and things are not working out:
// query-source port 53;
};
zone "." {
type hint;
file "root.hints";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "pz/127.0.0";
};
The `
The file named
; ; There might be opening comments here if you already have this file. ; If not don't worry. ; . 6D IN NS G.ROOT-SERVERS.NET. . 6D IN NS J.ROOT-SERVERS.NET. . 6D IN NS K.ROOT-SERVERS.NET. . 6D IN NS L.ROOT-SERVERS.NET. . 6D IN NS M.ROOT-SERVERS.NET. . 6D IN NS A.ROOT-SERVERS.NET. . 6D IN NS H.ROOT-SERVERS.NET. . 6D IN NS B.ROOT-SERVERS.NET. . 6D IN NS C.ROOT-SERVERS.NET. . 6D IN NS D.ROOT-SERVERS.NET. . 6D IN NS E.ROOT-SERVERS.NET. . 6D IN NS I.ROOT-SERVERS.NET. . 6D IN NS F.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 5w6d16h IN A 192.112.36.4 J.ROOT-SERVERS.NET. 5w6d16h IN A 198.41.0.10 K.ROOT-SERVERS.NET. 5w6d16h IN A 193.0.14.129 L.ROOT-SERVERS.NET. 5w6d16h IN A 198.32.64.12 M.ROOT-SERVERS.NET. 5w6d16h IN A 202.12.27.33 A.ROOT-SERVERS.NET. 5w6d16h IN A 198.41.0.4 H.ROOT-SERVERS.NET. 5w6d16h IN A 128.63.2.53 B.ROOT-SERVERS.NET. 5w6d16h IN A 128.9.0.107 C.ROOT-SERVERS.NET. 5w6d16h IN A 192.33.4.12 D.ROOT-SERVERS.NET. 5w6d16h IN A 128.8.10.90 E.ROOT-SERVERS.NET. 5w6d16h IN A 192.203.230.10 I.ROOT-SERVERS.NET. 5w6d16h IN A 192.36.148.17 F.ROOT-SERVERS.NET. 5w6d16h IN A 192.5.5.241
The file describes the root name servers in the world. This changes over time and must be maintained. See the maintenance section for how to keep it up to date.
The next section in
@ IN SOA ns.linux.bogus. hostmaster.linux.bogus. (
1 ; Serial
8H ; Refresh
2H ; Retry
1W ; Expire
1D) ; Minimum TTL
NS ns.linux.bogus.
1 PTR localhost.
Next, you need a
search subdomain.your-domain.edu your-domain.edu nameserver 127.0.0.1
The `
To illustrate what this file does: If a client tries to look up
The example assumes you belong in the domain
search subdomain.your-domain.edu your-domain.edu other-domain.com and so on. Obviously you need to put real domain names in instead. Please note the lack of periods at the end of the domain names. This is important, please note the lack of periods at the end of the domain names.
Next, depending on your libc version you either need to fix
/etc/nsswitch.conf
This is a long file specifying where to get different kinds of data
types, from what file or database. It usually contains helpful
comments at the top, which you should consider reading. After that
find the line starting with `
hosts: files dns If there is no line starting with `
/etc/host.conf
It probably contains several lines, one should start with
order hosts,bind
If there is no `
3.1 Starting namedAfter all this it's time to start named. If you're using a dialup
connection connect first. Type `
(the lines ending in \ continue on the next line)
If there are any messages about errors then there is a mistake. Named will name the file it is in (one of named.conf and root.hints I hope :-) Kill named and go back and check the file.
Now you can test your setup. Start nslookup to examine your work.
If that's what you get it's working. We hope. Anything else, go
back and check everything. Each time you change the
Now you can enter a query. Try looking up some machine close to
you.
nslookup now asked your named to look for the machine
If you ask the same again you get this:
Note the ``
3.2 Making it even betterIn large, well organized, academic or ISP (Internet Service
Provider) networks you will sometimes find that the network people has
set up a forwarder hierarchy of DNS servers which helps lighten the
internal network load and on the outside servers as well. It's not
easy to know if you're inside such a network or not. It is however
not important and by using the DNS server of your network provider as
a ``forwarder'' you can make the responses to queries faster and less
of a load on your network. If you use a modem this can be quite a
win. For the sake of this example we assume that your network
provider has two name servers they want you to use, with IP numbers
forward first;
forwarders {
10.0.0.1;
10.1.0.1;
};
Restart your nameserver and test it with nslookup. Should work fine.
3.3 CongratulationsNow you know how to set up a caching named. Take a beer, milk, or whatever you prefer to celebrate it.
Next Previous Contents |
|
|