How to run BIND behind a router
Hi all,
I just set up BIND on one of my CentOS 5 VM's, and it's working great for all of the PC's on my LAN. My problem is that I can't get to the internet through my DNS server. I believe that it is a problem with my router. I have a Netgear WPN-824 router, which is then connected to my cable modem. I added my router to the "named.conf" file - Code:
forward first; Code:
#ping google.com Is there something that I am missing in my named.conf file, or is this a router issue? TIA, JD |
i think you've got a few technologies mixed up here, this has *nothing* to do with DNS at all. either your router isn't passing the traffic, or the server in question doesn't have it correctly set as the default route. I guess as you've two routers by the lok of it, then you could be having some more complex routing issues between them, but we'd need to go into more detail about the network topology if that's likely.
|
Quote:
All of my PC's and VM's that are set to use DHCP from the router and have the router set as their gateway work fine. Anything that is set to use my DNS server as a gateway and DNS cannot get to the internet. They resolve everything on my internal domain fine, just can't resolve any remote name. When I ping a remote server from my DNS server or any of it's clients, ie. google.com, it resolves the IP, but then it won't ping and I get "Destination Host Unreachable". This is my first time setting up a DNS server obviously. I'm just doing this to learn something new by the way. I'm taking the RHCE class and exam in a few months, so I'm trying to learn as much as possible. I already got my RHCT, but that didn't cover any server side configurations. Any ideas? Let me know if you need any more info. |
can you describe the IP routing in an ascii diagram or something? if you've created a new subnet on your network i.e. "inside" it then the routers further on are not going to know about it unless you tell them, so they would need a route back to it.
|
Hmmm....maybe that's my problem. I'll try and describe my routing and addressing a little better.
My router is set to be a DHCP server for addresses 192.168.1.2 to 192.168.1.254, my router is 192.168.1.1. I'm guessing that I probably shouldn't be using any addresses withing that range for my domain and DNS server? Could you possibly describe the best way to set this up? I'm probably missing something very basic. Thanks a lot for your help! |
well if you only have one range, 192.168.1.0/24 then you can't have a routing device in the middle of that. what you seem to be describing is:
Code:
clients--192.168.1.0/24--server--192.168.1.0/24--router--[ip addressing?]--Modem--Inet Code:
clients |
Yea, that sounds about right. How would I go about configuring my clients to use my server for DNS, and my router for internet access? I'm guessing this is something in the /etc/resolve.conf? I guess I am a little confused. I thought the point of the root hints zone was so that the clients can go to my DNS server, then to the internet.
Edit - Do I need to make my router my gateway in ifcfg-eth0 and just have my DNS server in my resolv.conf file.? |
if you are doign DHCP then all those settings are standard fair for the dhcp server to handle.
|
My DNS server is not running DHCP, I don't know how to configure that yet. So I have my DNS server and it's clients using static IP's. I had all of the clients using my DNS server as their gateway, as well as their nameserver. I think my problem was that I also had my DNS server using itself as it's own gateway. I changed the configuration on my DNS server so that it's gateway is now the router, and now everything works. I can get to the internet now from my clients and my DNS server. I had turned packet forwarding on for my DNS server in /etc/sysctl.conf previously as well. Here is how it's set up.
Code:
Clients - |
you were trying to route via yourself? no wonder it wasn't going anywhere! :)
|
All times are GMT -5. The time now is 01:59 AM. |