LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Machine names don't work across LAN (https://www.linuxquestions.org/questions/linux-newbie-8/machine-names-dont-work-across-lan-797449/)

stonehinge03 03-23-2010 10:37 PM

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


MS3FGX 03-23-2010 11:04 PM

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.

stonehinge03 03-23-2010 11:09 PM

Quote:

Originally Posted by MS3FGX (Post 3909931)
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?

MS3FGX 03-23-2010 11:16 PM

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.

stonehinge03 03-23-2010 11:26 PM

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


Tinkster 03-23-2010 11:54 PM

Quote:

Originally Posted by stonehinge03 (Post 3909946)

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


All times are GMT -5. The time now is 09:15 AM.