You are not logged in.
Hi,
I cannot ping my hostname, no ip is resolved.
[hardik@moonlight: ~ ]$ ping moonlight
ping: unknown host moonlight
[hardik@moonlight: ~ ]$ hostname
moonlight
I have following entry in my /etc/hosts
[hardik@moonlight: ~ ]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost moonlight
# End of file
Last edited by rangalo (2010-03-06 19:34:00)
Offline
whats in resolv.conf?
Offline
and your rc.conf.
Offline
Here is the resolve.conf.
The ip is of my AVM fritzfon router. But shouldn't /etc/hosts have higher priority?
[hardik@moonlight: ~ ]$ cat /etc/resolv.conf
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
nameserver 192.168.178.1
# /etc/resolv.conf.tail can replace this line
[hardik@moonlight: ~ ]$ nslookup moonlight
Server: 192.168.178.1
Address: 192.168.178.1#53
** server can't find moonlight: NXDOMAIN
EDIT:
Here the link to rc.conf
http://pastebin.com/4v5Tj6F9
Last edited by rangalo (2010-03-05 18:08:11)
Offline
what is the host name in rc.conf?
Offline
@kgas: It is "moonlight" see the link above.
I am sure, this was working before. I cannot tell which upgrade broke it though.
Offline
I did not see the previous post while typing (4 mins late). Could you able to ping your assigned IP? If you are using dual boot check any port got blocked if you use a firewall.
Offline
Yes, I can ping the assigned ip.
Offline
is your loop back is up?(ifconfig -a).
Offline
Yes,
[hardik@moonlight: docs ]$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:6F:00:17:34
inet addr:192.168.178.26 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::216:6fff:fe00:1734/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:158184 errors:2 dropped:2 overruns:0 frame:0
TX packets:112981 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:217372073 (207.3 Mb) TX bytes:10787381 (10.2 Mb)
Interrupt:17 Base address:0xc000 Memory:dfcfd000-dfcfdfff
eth1 Link encap:Ethernet HWaddr 00:14:22:EB:15:A7
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:18
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:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:940 (940.0 b) TX bytes:940 (940.0 b)
Offline
what does this give u?
daf666@pazuzu ~
$ host pazuzu
pazuzu has address 127.0.0.1
Offline
What's your /etc/hosts? You have to specify your hostname there too, i.e.
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost moonlight
Offline
Here the output of host command
[hardik@moonlight: ~ ]$ host moonlight
Host moonlight not found: 3(NXDOMAIN)
Offline
OK.. so the host name is sent to the DNS (what U got in resolv.conf) instead of being resolved locally, for reasons unknown.
Verify it like this:
# tcpdump -nni eth0 port 53 &
# ping moonlight
show output and we will work from there.
In addition, add this to /etc/hosts:
192.168.178.26 doom
then ping it by name
Offline
Here the output from tcpdump while pinging moonlight
[hardik@moonlight: ~ ]$ tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
13:23:09.850470 IP 192.168.178.26.45929 > 192.168.178.1.53: 41817+ A? moonlight. (27)
13:23:09.906559 IP 192.168.178.1.53 > 192.168.178.26.45929: 41817 NXDomain 0/1/0 (102
Here pinging doom after adding the entry in /etc/hosts
[hardik@moonlight: ~ ]$ ping doom
ping: unknown host doom
13:25:24.777568 IP 192.168.178.26.42017 > 192.168.178.1.53: 55338+ A? doom. (22)
13:25:24.832493 IP 192.168.178.1.53 > 192.168.178.26.42017: 55338 NXDomain 0/1/0 (97)
Looks like entries in /etc/hosts have no effect !
Last edited by rangalo (2010-03-06 12:29:38)
Offline
Found the reason and also the solution.
The keyword is /etc/nsswitch.conf file.
On my system, this file was corrupted. Lately I had many files corrupted due to some unknown reason.
I moved the file to a backup one and reinstalled filesystem package, which fixed the issue.
Is there any way to know which files are corrupted ?
regards,
Hardik
Offline