Personal computing discussed

Moderators: renee, Steel, notfred

 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Newb Question: Linux DNS Client problem

Tue Feb 24, 2009 9:52 pm

Hey folks.

Quick question for TR's Linux community. I've setup a Ubuntu Server installation on an old computer to experiment with and I'm having a strange problem. In a nutshell, I can't ping it via hostname from a Windows client, but I can from a Linux based client. Pings by IP work both ways, I can nslookup/host lookup both the windows clients and the ubuntu client successfully. My local DNS is provided by a WRT54GL running Tomato (it can ping the Ubuntu system by hostname).

I've been googling this without much success, can anyone shed some light on it for me? The only thing I can think of is that Linux handles its DNS client settings differently than Windows.

Thanks for reading.
 
titan
Grand Gerbil Poohbah
Posts: 3376
Joined: Mon Feb 18, 2002 7:00 pm
Location: Great Smoky Mountains
Contact:

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 12:00 am

Actually, Windows and Linux handle DNS the same way. They both use a hosts file. The first thought that came to me is that Windows doesn't access network shares the same way. Do you have Samba running on your server?
The best things in life are free.
http://www.gentoo.org
Guy 1: Surely, you will fold with me.
Guy 2: Alright, but don't call me Shirley.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 12:08 am

titan wrote:
Actually, Windows and Linux handle DNS the same way. They both use a hosts file.

...and your DNS server, assuming it is is configured.

The first thought that came to me is that Windows doesn't access network shares the same way. Do you have Samba running on your server?

Well... yeah, Windows boxes can find each other through the NetBIOS name resolution mechanism, which won't be active on the Linux box unless Samba is set up.

However, the thing that puzzles me is he says that the router is acting as his DNS server, and the router sees the Linux box. So something strange is afoot.
Nostalgia isn't what it used to be.
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 9:38 am

Corrupt DNS cache on the Windows clients? I think it's something like "ipconfig /flushdns" to clear.
 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 11:28 am

Lonewolf08 wrote:
The only thing I can think of is that Linux handles its DNS client settings differently than Windows.

I should have posed this as a question, thanks all for clearing that up for me though.

JBI, concerning the router; I'm not quite sure it's a true DNS Server. I just know it's acting as my DHCP assigned DNS. I have Tomato's DNS caching setting turned on so it's caching DNS entries from my ISP's DNS. The clients are all set to use the router as their DNS source. My Ubuntu server shows up in the routers Device list along with it's leased IP address. I can successfully nslookup the server by name, I just can't ping it by name from Windows (but I CAN from Linux based systems).

No I do not have Samba installed, not yet anyway. I started with a default server with no extra packages to try to get the hand of the bash terminal and Linux in general.

If I install Samba and that resolves the problem, will that most likely prove is to be a NetBIOS issue? I just think it's strange that I can successfully resolve the server hostname but can't ping it. I'll try to flush the cache tonight and test again before I install Samba.

Also, if it matters, the Ubuntu server is running in VirtualBox, to rule out any shared network card oddities I did my ping testing from another system.

Thanks for the replies guys! :D
 
titan
Grand Gerbil Poohbah
Posts: 3376
Joined: Mon Feb 18, 2002 7:00 pm
Location: Great Smoky Mountains
Contact:

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 12:47 pm

Lonewolf08 wrote:
Lonewolf08 wrote:
The only thing I can think of is that Linux handles its DNS client settings differently than Windows.

I should have posed this as a question, thanks all for clearing that up for me though.

JBI, concerning the router; I'm not quite sure it's a true DNS Server. I just know it's acting as my DHCP assigned DNS. I have Tomato's DNS caching setting turned on so it's caching DNS entries from my ISP's DNS. The clients are all set to use the router as their DNS source. My Ubuntu server shows up in the routers Device list along with it's leased IP address. I can successfully nslookup the server by name, I just can't ping it by name from Windows (but I CAN from Linux based systems).

As I understand it, this is par for the course. On my clients -- Linux, XP and Vista -- they all show my router as the name server instead of the ISP's name server. I haven't been bothered enough to find out why it would work that way, I've just been satisfied to know that it works.

Lonewolf08 wrote:
No I do not have Samba installed, not yet anyway. I started with a default server with no extra packages to try to get the hand of the bash terminal and Linux in general.

If I install Samba and that resolves the problem, will that most likely prove is to be a NetBIOS issue? I just think it's strange that I can successfully resolve the server hostname but can't ping it. I'll try to flush the cache tonight and test again before I install Samba.

Also, if it matters, the Ubuntu server is running in VirtualBox, to rule out any shared network card oddities I did my ping testing from another system.

Thanks for the replies guys! :D


What I'm thinking is that you do not have a true DNS server running on your router. The router is just forwarding the DNS requests to the ISP's name server. Normal operation. Now, I have no experience with your router or the firmware that it is running. So, it is entirely possible that I could be wrong on this. It may cache entries, but that won't do any good for your local network as none of the machines will have a globally unique address and won't be registered with your ISP's name servers in the first place.

My theory is that the reason you're able to reach the Linux server using its host name from your Linux client is because of how IPv6 operates. One feature of IPv6 is neighbor discovery, in which every machine within one hop is a neighbor, and it also grabs the machine host names. So, your Windows client may not be running IPv6, which would leave IPv4. IPv4 does not have neighbor discovery, so it will not automatically grab host names. This could be the actual "problem" you're having. "Why is 'problem' in quotes?", I hear you ask. Because everything is working just as it should, so there really isn't a problem to be fixed.

Now, I'm guessing since your asking about this, you're like everyone else and would rather type in a name rather than an IP address. You'll have to edit the hosts file on your Windows client to do this.

C:\WINDOWS\system32\drivers\etc\hosts
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
192.168.x.x   servername


Replace 192.168.x.x and servername with the IPv4 address and host name of your server. This should do the trick.
The best things in life are free.
http://www.gentoo.org
Guy 1: Surely, you will fold with me.
Guy 2: Alright, but don't call me Shirley.
 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 1:04 pm

Thanks for the tip. I'll look into the IPv6 theory. What really doesn't make sense to me though is that I can successfully nslookup from the Windows client, but not ping. Doesn't that mean that the ping command should be able to resolve the hostname, or am I misunderstanding how things work?
 
titan
Grand Gerbil Poohbah
Posts: 3376
Joined: Mon Feb 18, 2002 7:00 pm
Location: Great Smoky Mountains
Contact:

Re: Newb Question: Linux DNS Client problem

Wed Feb 25, 2009 3:18 pm

Lonewolf08 wrote:
Thanks for the tip. I'll look into the IPv6 theory. What really doesn't make sense to me though is that I can successfully nslookup from the Windows client, but not ping. Doesn't that mean that the ping command should be able to resolve the hostname, or am I misunderstanding how things work?

The output from your nslookup would help us see a bit of the picture.
The best things in life are free.
http://www.gentoo.org
Guy 1: Surely, you will fold with me.
Guy 2: Alright, but don't call me Shirley.
 
titan
Grand Gerbil Poohbah
Posts: 3376
Joined: Mon Feb 18, 2002 7:00 pm
Location: Great Smoky Mountains
Contact:

Re: Newb Question: Linux DNS Client problem

Sat Feb 28, 2009 4:47 pm

So, what's the story? Was I right?
The best things in life are free.
http://www.gentoo.org
Guy 1: Surely, you will fold with me.
Guy 2: Alright, but don't call me Shirley.
 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Re: Newb Question: Linux DNS Client problem

Sat Feb 28, 2009 10:59 pm

Here's the result of the nslookup from a windows client.

C:\> nslookup linux-server
Server:  UnKnown
Address:  192.168.1.1  (This is my Router)

Name:    linux-server
Address:  192.168.1.44 (This is the correct address of the Linux-Server)


And here's the result of an attempt to ping by hostname.

C:\>ping linux-server
Ping request could not find host linux-server. Please check the name and try again.


Weird right?

I installed Samba to test the theory about NetBIOS and that solved it. I can now ping by hostname successfully. Thanks for the help guys. About the original question though, is there something to networking I'm missing here? If a client can resolve the hostname to an ip address, shouldn't it be able to ping it?

Bonus round, if you have any links to some good beginners Linux guides I'd really appreciate it! :)
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 9:26 am

I'm suspecting some DNS search domain weirdness. Can you post the output of "ipconfig /all"?
 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 11:37 am

The windows client is configured to use the router as its DNS server.
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 2:13 pm

Yes, but what DNS domain (NOT Windows networking domain) is it in and what DNS domains does it search with a non-FQDN? There's a lot more to DNS than just "who is my DNS server" and that's what I am suspecting here.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 2:31 pm

Lonewolf08 wrote:
I installed Samba to test the theory about NetBIOS and that solved it. I can now ping by hostname successfully. Thanks for the help guys. About the original question though, is there something to networking I'm missing here? If a client can resolve the hostname to an ip address, shouldn't it be able to ping it?

Yes, it should. This part has me a bit puzzled as well. Either the host name is resolvable, or it isn't.
Nostalgia isn't what it used to be.
 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 2:48 pm

notfred wrote:
Yes, but what DNS domain (NOT Windows networking domain) is it in and what DNS domains does it search with a non-FQDN? There's a lot more to DNS than just "who is my DNS server" and that's what I am suspecting here.

Ah I see, where would I look for that? I don't see those fields anywhere in ipconfig /all. I see the information for the actual adapter and the IPv6 tunnels.

ipconfig /displaydns shows techreport (of course) and loopback information. If it makes a difference, I'm using a Vista x64 SP1 client (I can test from XP if that'd eliminate some variables).
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 4:17 pm

Sorry, I left Windows before Vista came out. Does it no longer look like http://en.wikipedia.org/wiki/File:Ipconfig_win_xp.png ? I'm specifically interested in "Primary Dns Suffix", "DNS Suffix Search List" and "Connection-specific DNS Suffix" fields. If those are messed up that might be the problem.
 
Lonewolf08
Gerbil First Class
Topic Author
Posts: 188
Joined: Fri Jan 18, 2008 12:03 pm

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 4:44 pm

Ahh, I see. Those fields are all blank, I missed them the first time. I suppose that probably means my router isn't a real DNS server?
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 8:33 pm

I've moved this to the networking forum as it is more a networking issue than a Linux issue.

Not sure on what else to suggest here though.
 
Contingency
Gerbil Jedi
Posts: 1534
Joined: Sat Jun 19, 2004 4:03 pm
Location: al.us
Contact:

Re: Newb Question: Linux DNS Client problem

Sun Mar 01, 2009 8:40 pm

Flush cache and monitor the request with Wireshark. It's unlikely I'd be able to fix a Linux-specific issue though.
#182 TT: 13/DNVT, Precedence: Flash Override. Switch: Node Center. MSE forever.
 
bitvector
Grand Gerbil Poohbah
Posts: 3293
Joined: Wed Jun 22, 2005 4:39 pm
Location: San Francisco, CA

Re: Newb Question: Linux DNS Client problem

Tue Mar 03, 2009 2:20 am

just brew it! wrote:
Lonewolf08 wrote:
I installed Samba to test the theory about NetBIOS and that solved it. I can now ping by hostname successfully. Thanks for the help guys. About the original question though, is there something to networking I'm missing here? If a client can resolve the hostname to an ip address, shouldn't it be able to ping it?

Yes, it should. This part has me a bit puzzled as well. Either the host name is resolvable, or it isn't.

But the other thing to consider is that nslookup typically works differently from standard host resolution mechanisms since it is a DNS tool. Most standard applications use the system-wide stub resolver by calling some sort of standard system host resolution function in the style of gethostbyname (which handles system-wide search suffixes and, in the case of Windows, also does NetBIOS lookups). On the other hand, nslookup is a DNS-specific tool with its own resolution functionality so you can do custom queries (like MX, SOA, TXT, etc.), control servers, search suffixes and so forth. So it might be resolvable given the default search parameters on one but not the other (as notfred alluded to).

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On