other machine names on LAN are resolved to 127.0.0.1

Asked by Amr Hassan

I have three machines on my local network. for some reason all their names are resolved to the localhost's ip. I don't know why. I've edited samba's conf file and changed the name resolve order to: "lmhosts bcast host wins" but i suppose this is only for samba. pinging any machine name on my network tries to ping 127.0.0.1

How can I fix this? How are machine names resolved? I'm not much of a network expert, I'm just trying to connect three machines (two ubuntus and one windows xp) using samba.

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
sushant6759 (sushant-modulussystems) said :
#1

find more about this scoop at

http://mrknowsitall.wordpress.com/

Revision history for this message
Amr Hassan (amr-hassan) said :
#2

spam!?

Revision history for this message
MaXo (mahmood-188) said :
#3

try installing the package "winbind" :
sudo apt-get install winbind

then modify this file:
sudo pico /etc/nsswitch.conf

and after "hosts" add "wins" .. so it will look like this:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 wins

then reboot and see if it works..

Revision history for this message
Amr Hassan (amr-hassan) said :
#4

didn't work. still pinging to 127.0.0.1 and samba shares are not working. what to do now?

Revision history for this message
Michael Lustfield (michaellustfield) said :
#5

Can you give us the output of the following:

cat /etc/hosts
hostname
hostname -f
cat /etc/network/interfaces
ifconfig
dig 192.168.1.1 # or whatever your dns server is

Hopefully there's just something screwy for some really random reason.

Revision history for this message
Amr Hassan (amr-hassan) said :
#6

Here it is:

amr@gort:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 gort

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
amr@gort:~$ hostname
gort
amr@gort:~$ hostname -f
gort
amr@gort:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

amr@gort:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:21:9b:d9:14:49
          UP BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:59716 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59803 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25820963 (25.8 MB) TX bytes:21959246 (21.9 MB)
          Interrupt:16

eth1 Link encap:Ethernet HWaddr 00:1e:4c:c7:53:fc
          inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::21e:4cff:fec7:53fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:2506895 errors:0 dropped:0 overruns:0 frame:641491
          TX packets:2531883 errors:57 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:266209169 (266.2 MB) TX bytes:258308986 (258.3 MB)
          Interrupt:17 Base address:0xc000

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:121448 errors:0 dropped:0 overruns:0 frame:0
          TX packets:121448 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:54967470 (54.9 MB) TX bytes:54967470 (54.9 MB)

amr@gort:~$ dig 192.168.1.1

; <<>> DiG 9.5.1-P2 <<>> 192.168.1.1
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43376
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.1.1. IN A

;; ANSWER SECTION:
192.168.1.1. 655360 IN A 192.168.1.1

;; Query time: 822 msec
;; SERVER: 163.121.128.135#53(163.121.128.135)
;; WHEN: Mon Apr 20 19:41:00 2009
;; MSG SIZE rcvd: 45

Revision history for this message
Michael Lustfield (michaellustfield) said :
#7

Can you reboot and try to dig the other ip addresses on the network, and all try to dig their hostname

Revision history for this message
Amr Hassan (amr-hassan) said :
#8

I've already rebooted this machine several times today, I've also rebooted my router and this jaunty machine is the only one with the problem.

I dig-ged all the other IPs on my network and here's the output: (I don't really get what dig does)

amr@gort:~$ dig 192.168.1.100

; <<>> DiG 9.5.1-P2 <<>> 192.168.1.100
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12222
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.1.100. IN A

;; ANSWER SECTION:
192.168.1.100. 426966 IN A 192.168.1.100

;; Query time: 901 msec
;; SERVER: 163.121.128.134#53(163.121.128.134)
;; WHEN: Mon Apr 20 19:57:02 2009
;; MSG SIZE rcvd: 47

amr@gort:~$ dig 192.168.1.101

; <<>> DiG 9.5.1-P2 <<>> 192.168.1.101
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1594
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.1.101. IN A

;; ANSWER SECTION:
192.168.1.101. 598218 IN A 192.168.1.101

;; Query time: 215 msec
;; SERVER: 163.121.128.134#53(163.121.128.134)
;; WHEN: Mon Apr 20 19:57:23 2009
;; MSG SIZE rcvd: 47

amr@gort:~$ dig 192.168.1.102

; <<>> DiG 9.5.1-P2 <<>> 192.168.1.102
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54554
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.1.102. IN A

;; ANSWER SECTION:
192.168.1.102. 604789 IN A 192.168.1.102

;; Query time: 243 msec
;; SERVER: 163.121.128.134#53(163.121.128.134)
;; WHEN: Mon Apr 20 19:58:06 2009
;; MSG SIZE rcvd: 47

amr@gort:~$ dig 192.168.1.103

; <<>> DiG 9.5.1-P2 <<>> 192.168.1.103
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42999
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.1.103. IN A

;; ANSWER SECTION:
192.168.1.103. 604800 IN A 192.168.1.103

;; Query time: 231 msec
;; SERVER: 163.121.128.134#53(163.121.128.134)
;; WHEN: Mon Apr 20 19:58:11 2009
;; MSG SIZE rcvd: 47

Revision history for this message
Michael Lustfield (michaellustfield) said :
#9

Can you try to dig the hostnames too.

Revision history for this message
Amr Hassan (amr-hassan) said :
#10

here's something weird. host names with .local suffix are working fine. what are those? why is it like that?

Revision history for this message
Michael Lustfield (michaellustfield) said :
#11

Can you try to dig the hostnames too?
  - And attach the output in a file.

Revision history for this message
Amr Hassan (amr-hassan) said :
#12

here it is: http://dl.getdropbox.com/u/197580/dig_output.txt

the machine "kimo" is the only one with this problem now, the other one is resolving fine.

Revision history for this message
Michael Lustfield (michaellustfield) said :
#13

That link is dead. I guess you can only attach files in bugs.

It seems that the best thing you could really do is just shut down your systems for a little bit. By this, I mean any switches, routers, computers, etc.

If the issue is gradually fixing itself, then there is more than likely some screwed up arp somewhere.

Revision history for this message
Amr Hassan (amr-hassan) said :
#14

oops. i suspended my laptop before the file was done uploading, sorry. the link is working now http://dl.getdropbox.com/u/197580/dig_output.txt

i'll try shutting down all my machines and my router at once to clear out all the tables.
thanks a lot for your help.

Revision history for this message
Michael Lustfield (michaellustfield) said :
#15

This is very odd. I'll explain this output some:
(not trying to be condescending at all)

amr@gort:~$ dig nimbus # Your command
;nimbus. IN A # Your request
nimbus. 3600 IN A 0.0.0.0 # Your answer
;; SERVER: 163.121.128.134#53(163.121.128.134) # Who answered

You're getting a reply from an outside server. It should be coming from 192.168.1.1. It's possible your router is just reporting that as its IP though if it's either not setup right or a lower end router.

The odd part here is that the system is resolving to 0.0.0.0. If it can't be found, it should be blank.

ARP is definitely screwed up at some point. Hopefully it's just a cache that will fully resolve in time and ever better, after resets.

Can you help with this problem?

Provide an answer of your own, or ask Amr Hassan for more information if necessary.

To post a message you must log in.