LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2010, 11:37 PM   #1
stonehinge03
LQ Newbie
 
Registered: Jan 2010
Posts: 21

Rep: Reputation: 15
Machine names don't work across LAN


When the machine name is used to ping itself it will resolve and the ping completes. When the machine name of other computers on the LAN are used they don't resolve. You have to put in the raw IP numbers (192.168.1.x).

I have a router at 192.168.1.1 that seems to be configured fine. It uses the MAC address of one of the machines (cloned in) to keep the cable modem happy. Everything else works fine on the network, it's just that I can't use the names. The router sees those names, btw, and lists them as "attached devices".

What could be going on? Here is the output of dig:
Code:
 dig

; <<>> DiG 9.6.1-P2 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32277
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13

;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       279640  IN      NS      e.root-servers.net.
.                       279640  IN      NS      f.root-servers.net.
.                       279640  IN      NS      g.root-servers.net.
.                       279640  IN      NS      h.root-servers.net.
.                       279640  IN      NS      i.root-servers.net.
.                       279640  IN      NS      j.root-servers.net.
.                       279640  IN      NS      k.root-servers.net.
.                       279640  IN      NS      l.root-servers.net.
.                       279640  IN      NS      m.root-servers.net.
.                       279640  IN      NS      a.root-servers.net.
.                       279640  IN      NS      b.root-servers.net.
.                       279640  IN      NS      c.root-servers.net.
.                       279640  IN      NS      d.root-servers.net.

;; ADDITIONAL SECTION:
f.root-servers.net.     432044  IN      A       192.5.5.241
f.root-servers.net.     112569  IN      AAAA    2001:500:2f::f
g.root-servers.net.     529910  IN      A       192.112.36.4
h.root-servers.net.     528936  IN      A       128.63.2.53
h.root-servers.net.     295210  IN      AAAA    2001:500:1::803f:235
i.root-servers.net.     529756  IN      A       192.36.148.17
j.root-servers.net.     529190  IN      A       192.58.128.30
j.root-servers.net.     383477  IN      AAAA    2001:503:c27::2:30
k.root-servers.net.     123313  IN      A       193.0.14.129
k.root-servers.net.     530056  IN      AAAA    2001:7fd::1
l.root-servers.net.     285249  IN      A       199.7.83.42
l.root-servers.net.     529872  IN      AAAA    2001:500:3::42
m.root-servers.net.     123264  IN      A       202.12.27.33

;; Query time: 43 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Mar 23 23:32:53 2010
;; MSG SIZE  rcvd: 496

Last edited by stonehinge03; 03-23-2010 at 11:44 PM.
 
Old 03-24-2010, 12:04 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
That would only work if the router is providing local DNS service (coupled with the DHCP server) and your machine is set to use that as the primary DNS server. None of the information you have posted so far involves either of those points, so we don't have enough information to work on here.

Keep in mind that Windows machines resolve names on the network different than Linux machines (or any other OS, really). Windows machines continually broadcast their names to every machine in the local network, and eventually a small database is built up on each machine. For Linux/Unix, you need to use a name resolution service like DNS. Samba can be configured as such to let a Linux machine use the Windows name resolution service (WINS), but this is a bit of a hackish method and would be more of a last resort.

Last edited by MS3FGX; 03-24-2010 at 12:05 AM.
 
Old 03-24-2010, 12:09 AM   #3
stonehinge03
LQ Newbie
 
Registered: Jan 2010
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by MS3FGX View Post
That would only work if the router is providing local DNS service (coupled with the DHCP server) and your machine is set to use that as the primary DNS server. None of the information you have posted so far involves either of those points, so we don't have enough information to work on here.
...
Doesn't dig say that 192.168.1.1 (the router's LAN address) is the nameserver it is using? What output would be more helpful?
 
Old 03-24-2010, 12:16 AM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Well, the first thing you need to figure out is if the router even provides local DNS, not all of them do. You might spend all this time trying to troubleshoot the problem only to find it just isn't something your router does. As for the DNS configuration on the local machine, "dig" simply shows you what the DNS server it is connected to returns for root. It doesn't show anything about how DNS is configured on the local machine. That is in /etc/resolv.conf.

Since the router sees the hostnames of attached devices, we can assume that they are being reported properly during the DHCP negotiation, so therefore either the router doesn't serve DNS for local machines, or the DNS configuration isn't right. It could be the router only returns full domain names for local hosts, so you might need to give a different "search" parameter in resolv.conf.
 
Old 03-24-2010, 12:26 AM   #5
stonehinge03
LQ Newbie
 
Registered: Jan 2010
Posts: 21

Original Poster
Rep: Reputation: 15
This is the contents of /etc/resolv.conf:
Code:
root@server:/etc# more /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
The router has a check box that is checked that says "Use router as DHCP server". The names used to work. I have shut down a number of services, but all the services that the ubuntu gdm services administration tool gave warnings about turning off I left on. It was to eliminate ports being listened to. These are the services that listen at ports that are left. I.e. have I turned off something I shouldn't have? Something listening on port 53? I don't remember anything doing that originally, though.
Code:
root@server:/etc# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      13924/apache2
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      1383/vsftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1188/sshd
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      1256/ntop
tcp6       0      0 :::22                   :::*                    LISTEN      1188/sshd
udp        0      0 0.0.0.0:68              0.0.0.0:*                           794/dhclient
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           666/avahi-daemon: r
udp        0      0 0.0.0.0:55319           0.0.0.0:*                           666/avahi-daemon: r

Last edited by stonehinge03; 03-24-2010 at 12:50 AM.
 
Old 03-24-2010, 12:54 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by stonehinge03 View Post

The router has a check box that is checked that says "Use router as DHCP server". The names used to work.
Unless you have an interface on the router that
lets you map IPs to names it won't be providing
name-services.

No idea how your "names used to work" would have
come about, or how it stopped. If you have a local
DNS, and the router is the DHCP server you'd have to
put the local DNS servers IP into the routers config
for the DHCP clients to receive proper configurations
to enable name resolution.


The best thing to diagnose why it's failing now is
to remember what you changed before it failed ;}


Cheers,
Tink
 
  


Reply

Tags
ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lan connection between linux machine and windows machine arunsan842004 Linux - Laptop and Netbook 1 11-25-2008 06:44 AM
machine has adsl ethernet modem, to make it gateway over lan do i need more lan cards b0nd Linux - Networking 2 10-04-2005 11:19 PM
DNS domain + machine names paul_mat Linux - Networking 1 08-09-2005 12:28 PM
how does dns/host names work on local lan gman_O0O0 Linux - Networking 1 04-11-2005 01:22 AM
1 machine, 1 IP 4 domain names(HOWTO)? plisken Linux - Networking 3 03-26-2004 03:13 AM


All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration