LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to run BIND behind a router (https://www.linuxquestions.org/questions/linux-networking-3/how-to-run-bind-behind-a-router-633592/)

JD50 04-07-2008 02:31 AM

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;
          forwarders {
              192.168.1.1;
};

That helped, now when I ping "google.com" I get this -

Code:

#ping google.com
PING google.com (64.233.167.99) 56(84) bytes of data.
From 192.168.1.9 icmp_seq=1 Destination Host Unreachable
From 192.168.1.9 icmp_seq=2 Destination Host Unreachable
From 192.168.1.9 icmp_seq=3 Destination Host Unreachable

192.168.1.9 is the IP of my DNS server.

Is there something that I am missing in my named.conf file, or is this a router issue?

TIA,

JD

acid_kewpie 04-07-2008 03:12 AM

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.

JD50 04-07-2008 04:23 AM

Quote:

Originally Posted by acid_kewpie (Post 3113221)
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.

Ok, here is my setup. I have a regular PC and I have a server. I have VMware server running on my server. I've made a network of VMs, a couple clients and one DNS server. I created a separate domain for my VM network, example.com. My PC, server, and VM's are connected to a router, which then goes to my comcast cable modem, then out to the internet.

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.

acid_kewpie 04-07-2008 04:26 AM

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.

JD50 04-07-2008 05:05 AM

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!

acid_kewpie 04-07-2008 05:10 AM

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
it seems that you probably don't want to be using the server in this position at all, the clients should be going direct to the router to get to the net, whilst using the server for dhcp and dns if you want them to be doing so.

Code:

clients
  |
  +--192.168.1.0/24--router--[ip addressing?]--Modem--Inet
  |
server


JD50 04-07-2008 05:19 AM

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.?

acid_kewpie 04-07-2008 05:35 AM

if you are doign DHCP then all those settings are standard fair for the dhcp server to handle.

JD50 04-07-2008 02:43 PM

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 -

IPADDR=192.168.1.x
NETMASK=255.255.255.0
GATEWAY=192.168.1.9 # That's my DNS server

DNS Server

IPADDR=192.168.1.9
NETMASK=255.255.255.0
GATEWAY=192.168.1.1 # That's my router

Like I said, I'm new to this, so if there is a more efficient way of doing things please let me know. Thanks a lot for your help!

acid_kewpie 04-07-2008 04:30 PM

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.