Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have redhat 8.0 set as a dhcp and firewall for our small peer to peer network. I want to also use it as a dns caching nameserver. we are not set up as a domain only a simple or peer to peer network. I'm unclear as to setting up a caching nameserver. All the help I find online is really confusing, overkill to be exact. Could someone guide me right.....thanks

I believe this will work as a caching nameserver possibly in the way you are desiring. Take your DNS ip addresses and add them to the /etc/named.conf file in the "options" area after "forwarders" in the manner below (replace 24.128.60.8 with your first DNS, for example):
options {
directory "/var/named";
forward only;
forwarders {
24.128.60.8;
24.128.60.7;
24.128.1.81;
};You will need to add this server's ip address (LAN) as the first nameserver entry in the /etc/resolv.conf file on each machine that will be using this caching nameserver as the server. Then, each DNS request from a client will go through the caching nameserver, and if it it's in the cache, it will resolve it without having to send it "forward". If it's not in the cache, it will go to the first "forwarder" and resolve it, and then it will be cached the next time it is needed by someone on the network and won't be needed to be resolved by a "forwarder".
Once the /etc/named.conf is properly modified, enter "service named restart" at a command prompt to get it working for now. Enter "ntsysv" (or "setup", then "System services") from a command prompt and check "named" and then OK to allow the named daemon to load at boot time.
Good luck.

thank you...that helps so much...my only other question is...when you say I need to add this servers IP address in /etc/resolv.conf...now I have 3 nic cards in this machine. One connects to our ISP, the other two connect to subnet one and subnet two. So I assume I put the ip address our ISP assined to us in the etc/resolv.conf file along with the domain name and nameserver addresses from them, right? Kris

The DNS ip addresses your ISP gave you should go into the /etc/named.conf file like I mentioned above. I believe that even on your server, the DNS entry in your /etc/resolv.conf should be the caching nameserver and not the DNS addresses provided by your ISP. Although, it wouldn't hurt if your server wasn't reaping the benefits of the caching nameserver that the client machines are, but why hold it back?
My single PC here is set up that way. It's a client and a server, running the caching nameserver and has itself as the first nameserver entry in the /etc/resolv.conf file.
One thing I don't know, however, is which of your IP addresses would be the caching nameserver on a PC with multiplie NICs. Maybe you can tell me.
Let me know if I've confused you further.
Good luck.

Well, I did as said and I hooked up my server to the network again and everyone can get on the internet and everything works. In my /etc/resolv.conf file I put:
search localhost
nameserver x.x.x.x(ip of subnet #1)
nameserver x.x.x.x(ip of subnet #2)
nameserver x.x.x.x(ip of my ISP)I assume this is ok...or should it be changed. do you know what test I can run to check if name searches are being found in the cache first as opposed to my ISP?

I'm confused as to your nameserver entries. You say "ip of subnet #1" for the first entry. Do you mean "ip of caching nameserver in subnet #1"? This I would agree with, with the ISP's DNS servers at the bottom of the list. "ip of subnet #1" could be misunderstood as "10.10.10.0", for instance (netmask 255.255.255.0), as this is an example subnet.
Also, are you referring to the /etc/resolv.conf file on all machines? Not just the server, right?
As far as a test is concerned, no, I don't know of any such software, although it seems logical that it would exist somewhere. What I do to see if it appears to be working is ping something, like "ping www.yahoo.com", for instance, from a command prompt. Then, do it again a couple of times. The subsequent pings should show a resolved ip address much faster than the initial one. If the caching nameserver isn't working (or you're not using one), the subsequent pings aren't going to appear as instantaneous in the resolving of the ip address. I'd test this on the server first. But, keep in mind that "www.yahoo.com" is going to already be in the cache if you move to the next machine to test this, so you'll have to choose something else to resolve for each machine.
Good luck.

ok, I changed the resolv.conf file to read:
search Localhostnameserver x.x.x.x
nameserver x.x.x.x
etc.....
I used all three of my ISP's ip addresses. I tried to use, as the first nameserver, the ip address of my caching nameserver. My client computers are using win98 or win2000 pro. If I change the win2000 machine to use the ip address of my caching nameserver as the primary dns server, it doesn't work. Ive tried all the ip addresses on the linux box but nothing works except the ISP addresses. Also, I can't ping or use the internet with my linux box. It works great as the dhcp, and firewall. All my client machines can access the internet through it and everything. Maybe its my firewall thats causing the problems. I really appreciate you helping me.

Try that idea out by temporarily disabling your firewall. I loaded iptables with defaults and it didn't allow access to the nameserver so I think you're on the right track. I disabled the firewall and it worked again. I don't normally use a firewall on my system. You probably need to modify your firewall to allow access to the port that the nameserver is using.

![]() |
Installation without flop...
|
Networking Linux to windo...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |