telnet localhost slow, telnet 127.0.0.1 ok
If I run telnet localhost 22 then I have to wait 15-30 seconds before it
connects; with telnet 127.0.0.1 22 it connects at once. I have the same
results using other open ports.
Running strace telnet localhost 22 shows that it's trying to resolve the
hostname localhost by querying the nameserver. I thought that shouldn't
happen with my setup, though.
I'm running debian woody... any ideas why this might be happening and
how to solve it?
Rupert
/etc/hosts
127.0.0.1 localhost
192.168.0.205 deb150desktop
/etc/resolv.conf
nameserver 192.168.0.1
/etc/hostname
deb150desktop
/etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
deb150desktop:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:4F:4C:03:38:75
inet addr:192.168.0.205 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29528 errors:0 dropped:0 overruns:0 frame:0
TX packets:26981 errors:0 dropped:0 overruns:0 carrier:0
collisions:13 txqueuelen:100
RX bytes:3027177 (2.8 MiB) TX bytes:8676934 (8.2 MiB)
Interrupt:11 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:634 errors:0 dropped:0 overruns:0 frame:0
TX packets:634 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:224937 (219.6 KiB) TX bytes:224937 (219.6 KiB)
deb150desktop:~# host localhost
localhost has address 127.0.0.1
Reply to: