Local Computers names not showing up on network

Asked by underwater

I have had a problem with the nameserver working with the local network names ever since I upgraded from 7.10 to 8.04 which I am still on. The quick fix was to lock everything down on the router dhcp and enter the addresses by hand into the file hosts. I would really like to get the system working where it is not locked down.

The system accesses the internet just fine but refuses to identify local names of computers without them being defined in the hosts file. One of the computers defined on my local lan is called linux-server which is at 192.168.1.106 My router (netgear 824v2) is defined at 192.168.1.1

if I use hosts or dig it will not find linux-server (local computer defined at 192.168.1.106). Any hints what might be wrong. I have looked at the files resolv.conf and interfaces but discover nothing wrong. below is the information on these plus dig and host output.

hiflyer@Linux-bee:~$ cat /etc/resolv.conf
search ROAD_RUNNER
nameserver 192.168.1.1

hiflyer@Linux-bee:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

address 127.0.0.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

hiflyer@Linux-bee:~$ host linux-server
Host linux-server not found: 3(NXDOMAIN)

hiflyer@Linux-bee:~$ dig linux-server

; <<>> DiG 9.4.2-P2 <<>> linux-server
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12901
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;linux-server. IN A

;; AUTHORITY SECTION:
. 30 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2008111801 1800 900 604800 86400

;; Query time: 34 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Nov 18 17:33:33 2008
;; MSG SIZE rcvd: 105
hiflyer is online now Report Post Edit/Delete Message

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
underwater
Solved:
Last query:
Last reply:
Revision history for this message
Anton Roeder (filtered4spam) said :
#1

In order for your local computers' names to be recognized, you need to store them somewhere. If you don't address them using their IP-address, "someone" has to tell your computer where to find them. This is what the nameserver does. Since you use your router as a nameserver, you would have to create a hosts file on the router. I don't know if your router supports that.
Otherwise you have to use your local hosts file. I don't see a way around creating such a file _somewhere_ in your network. Having a central place, like the router, has the advantage that all computers on the network can use one file, so you don't have to copy it to all hosts on the network. I'm not sure about the setup you need on the Nameserver's side (i.e. your router).

Something else: I don't understand what the "search ROAD_RUNNER" is doing in your /etc/resolv.conf
This should be an existing domain name, I think. Something like "example.org". Thus, if you did a name search for some host (e.g. examplehost), without giving the domain, it would search these domains. If you did a "host examplehost", it would try to resolve "examplehost" as a fully qualified domain name, find that it wasn't really a fully qualified domain name (since by default the "ndots"-option in /etc/resolv.conf is 1, meaning that anything _without_ a dot is interpreted as _not_ fully qualified domain name) and then append the terms in the "search" directive one by one.

So in your case, it searches "linux-server.ROAD_RUNNER" which is not a valid domain name, of course.

Basically, you need to setup your router as a full DNS-Server for your local network or create the hosts file on all computers in your local network to resolve the local network names.

Hope this helps ;-)

Revision history for this message
underwater (nexcom) said :
#2

I understand the answer but am somewhat confused yet.

when I ran on 7.10, it did not use a central host file. I never created one. It somehow got the information from the router (i presume). When I upgraded to 8.04, local computers disappeared from the listings and I had to fix the host file. So I wonder why 8.04 requires a central host file and yet 7.10 and below did not.

in any case, thanks for your response. it is very much appreciated.

oh, Road_Runner is my workgroup. I did not write this in resolv.conf, ubuntu did as is I was playing with the interfaces file and adding in eth0 and eth1. It must have read it from the router as that and in the network definiton when I installed Ubuntu from version 6 somthing. I do not use a domain and am not sure under the home setup why I would want to.

thanks in any and all help.

Revision history for this message
underwater (nexcom) said :
#3

I have found the real answer. When I upgraded, samba would not work correctly and I had to define the local computers in the host file. I have now found if I remove all host definitions except the 127.0.0.1 and 127.0.1.1 definitions, the network browers now find the local servers and samba seems to be working just fine. If I undefine only one of these addresses, then the terminal server client does not fine the local computer. Apparently when I have any such definitions in the host file, it does not properly interrigate the router and as a result does not find the local computers. I do not know when they fixed the original problem but it seems to be working correctly now. Thanks for the help that has been offered but as a result of this there is no need to set up a DNS and a DHCP server on my server computer which is just one more thing to maintain.

under the above conditions dig and host do not find the local computers but that is not a problem to me.

Revision history for this message
Anton Roeder (filtered4spam) said :
#4

I'm glad that it's solved now. I thought you were trying to create a setup in which you could use the hostnames of your computers in any network operation, i.e. do something like "ssh linux-server" without having to give an ip. Samba is an entirely different kettle of fish. It uses the netbios protocol family for resolution of host names, which is only very indirectly connected to the tcp/ip protocol family used by most machines not running windows these days. Also, netbios has nothing to do with DNS, so dns-settings (such as those in /etc/resolv.conf) don't relate to this issue.

Giving a hint to samba (or the intended use of your setup in general) would have helped in finding the source of the problem.

Anyways, thank you for adding the information how it was solved.

Cheers, Anton