LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   External Hosts Resolve but Local Hosts Do Not (https://www.linuxquestions.org/questions/linux-networking-3/external-hosts-resolve-but-local-hosts-do-not-381285/)

kjm9 11-08-2005 08:28 PM

External Hosts Resolve but Local Hosts Do Not
 
I'm having a weird DNS problem. My linux box (Slackware 10.2) will resolve external host names but not host names on my local network. For example I can ping yahoo or this site, but not any of the local machines by name.

My setup is 2 WinXP boxes and 1 linux box netted togather with a Netgear wireless router which connects to the Internet via a Direcway modem. I'm using DHCP and the wireless router is the DHCP server (192.168.1.1). The XP boxes operate fine, getting both internal and external name resolved fine. They are running as a simple workgroup (no windows domain or WINS server). I'm using dhcpcd in the linux box.

Doing an nslookup of any of the local machines from the linux machine returns this error (doesn't matter if I use a full name miller9.direcway.com):
Code:

root@miller7:~# nslookup miller9
Server:        192.168.1.1
Address:        192.168.1.1#53
** server can't find miller9: NXDOMAIN

Resolv.conf looks OK I think:
Code:

nameserver 192.168.1.1
search direcway.com

Route returns:
Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.1.0    *              255.255.255.0  U    0      0        0 wlan0
loopback        *              255.0.0.0      U    0      0        0 lo
default        192.168.1.1    0.0.0.0        UG    0      0        0 wlan0

I do not want to hardcode the other machines into the host table; I sometimes bring in other machines and want to use DHCP for what it was intended.

Any ideas on where to start troubleshooting this?

TIA

MensaWater 11-09-2005 01:48 PM

Your /etc/resolv.conf is specifying to use a host at 192.168.1.1 as a nameserver. It is also saying that any host you don't type in the Fully Qualified Domain Name (FQDN) for should get "direcway.com" appended to it. Therefore when you type "nslookup miller9" it is actually looking for "miller9.direcway.com".

1) Is 192.168.1.1 running a DNS nameserver? (Since its responding I'm assuming it is but just want to make sure you know.)

2) Is the FQDN of miller9 actually miller9.direcway.com? If not then that's your problem - you either need to specify the FQDN of miller9 in your nslookup OR modify the DNS setup on 192.168.1.1 so it know the correct domain name then add that to your search statement. (You can have multiple domains in your search such as "search direcway.com billybob.com".)

3) Is miller9 even IN your DNS setup on 192.168.1.1? If not then it won't find it even with the correct FQDN.

kjm9 11-09-2005 02:03 PM

Thanks for the suggestions
Quote:

Originally posted by jlightner
Your /etc/resolv.conf is specifying to use a host at 192.168.1.1 as a nameserver. It is also saying that any host you don't type in the Fully Qualified Domain Name (FQDN) for should get "direcway.com" appended to it. Therefore when you type "nslookup miller9" it is actually looking for "miller9.direcway.com".

1) Is 192.168.1.1 running a DNS nameserver? (Since its responding I'm assuming it is but just want to make sure you know.)

Yes. It resolves outside names and is reported as the DNS nameserver by my windows boxes which work fine.
Quote:

2) Is the FQDN of miller9 actually miller9.direcway.com? If not then that's your problem - you either need to specify the FQDN of miller9 in your nslookup OR modify the DNS setup on 192.168.1.1 so it know the correct domain name then add that to your search statement. (You can have multiple domains in your search such as "search direcway.com billybob.com".)
Yes, the FQDN should be miller9.direcway.com. That is what appears when pinging from the windows boxes on my little network.
Quote:

3) Is miller9 even IN your DNS setup on 192.168.1.1? If not then it won't find it even with the correct FQDN.
Oh yes. miller9 is one of the windows machines and it resolves just fine from the other windows machine and itself. I get the same answer when I do an nslookup of any of the 3 machines on the network from the linux box, including if I nslookup the linux box itself.

MensaWater 11-09-2005 02:31 PM

On your windows machine if you open a DOS window (Start-->Run-->Cmd on XP) then type "nslookup miller9" what response do you get?

kjm9 11-09-2005 08:07 PM

Quote:

Originally posted by jlightner
On your windows machine if you open a DOS window (Start-->Run-->Cmd on XP) then type "nslookup miller9" what response do you get?
Code:

C:\>nslookup miller9
*** Can't find server name for address 192.168.1.1: Non-existent domain
*** Default servers are not available
Server:  UnKnown
Address:  192.168.1.1

*** UnKnown can't find miller9: Non-existent domain

Thank you, that's very interesting. I'd assumed because ping and tracert worked on the windows boxes that nslookup also worked. Ping and traceroute do not work on the linux machine.

Looks like I need to maybe look at my router configuration. Other ideas?

MensaWater 11-10-2005 06:54 AM

In my resolv.conf files I always have the search entries before the nameserver entries. Not sure that makes a difference but since you're getting messagins complaining about domain I wonder if it does? Also you have "direcway.com" - its not supposed to be "directway.com" by any chance?

Although home routers do normally provide DHCP they don't usually provide DNS. Does yours? Did you set up a zone file on it. It wouldn't just discover your machines so far as I know.

There should be a zone file called direcway.com that has an A record for miller9. zone files are usually under /var/named or /var/name/var/named if chroot jail is in effect. Not sure where it would be on your router if it has one (as noted I wouldn't think the router does).

Entry should be something like:
miller9 IN A 192.168.1.1

You should also have a PTR record for reverse lookups:
192.168.1.1 IN PTR miller9.direcway.com.

It really sounds to me as if your issue is you're expecting the router to provide automatic DNS for your own network and it likely doesn't. If you really want to have DNS for your own network you'd need to install and configure BIND 9x.

kjm9 11-10-2005 07:17 AM

Quote:

Originally posted by jlightner
In my resolv.conf files I always have the search entries before the nameserver entries. Not sure that makes a difference but since you're getting messagins complaining about domain I wonder if it does? Also you have "direcway.com" - its not supposed to be "directway.com" by any chance?
No, "direcway.com" is right.
Quote:

Although home routers do normally provide DHCP they don't usually provide DNS. Does yours? Did you set up a zone file on it. It wouldn't just discover your machines so far as I know.
I thought it was doing DNS because it returns itself as the DNS server when doing DHCP, but I suspect you are right and that it does not
Quote:

There should be a zone file called direcway.com that has an A record for miller9. zone files are usually under /var/named or /var/name/var/named if chroot jail is in effect. Not sure where it would be on your router if it has one (as noted I wouldn't think the router does).

Entry should be something like:
miller9 IN A 192.168.1.1

You should also have a PTR record for reverse lookups:
192.168.1.1 IN PTR miller9.direcway.com.

My router has none of that. It just has an HTML admin interface. I can configure the IP range (192.168.1.1-51) and default domain (direcway.com), but not much more.
Quote:

It really sounds to me as if your issue is you're expecting the router to provide automatic DNS for your own network and it likely doesn't. If you really want to have DNS for your own network you'd need to install and configure BIND 9x.
I think you are right. I'm thinking I might need to configure the linux box to provide local DNS, and maybe WINS as well. I'll look it some more and see if that makes sense.

The one question would be how to do that where the router is providing DHCP. The router is on all the time, but the linux machine is not. I'll look into that this evening.

Thanks!

kjm9 11-19-2005 03:51 PM

Just to let folks know I got DNS working on my linux box. It is set up to resolve as master for the local network and then use the router to resolve all other (external) addresses.. I had to hardcode more stuff than I would like to in the long run but it seems to work OK.

Unfortunately that did not solve the real problem, which is trying to print to printers on the Windows machines from the linux box, but I'll start a seperate thread for that.

Thanks.


All times are GMT -5. The time now is 07:24 PM.