Вчера целый день настраивал авторизацию ntlm в squid, а сегодня выяснилось, что перестал резолвиться localhost oO
По поиску пробежался - ни один из советов не помог.
[console]ns1:/etc # ping localhost
ping: unknown host localhost
ns1:/etc # nslookup localhost
Server: 192.168.1.107
Address: 192.168.1.107#53
Non-authoritative answer:
Name: localhost
Address: 127.0.0.1
ns1:/etc # cat /etc/hosts
127.0.0.1 localhost.lan localhost
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
ns1:/etc # cat /etc/nsswitch.conf |grep hosts
hosts: files dns
ns1:/etc # ls -l /etc/nsswitch.conf
-rw-r--r-- 1 root root 1517 2010-11-15 14:46 /etc/nsswitch.conf
ns1:/etc # ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:4F:1A:55:2C
inet addr:217.195.83.93 Bcast:217.195.83.95 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18089784 errors:0 dropped:0 overruns:0 frame:0
TX packets:19582436 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3259191167 (3108.2 Mb) TX bytes:4136437626 (3944.8 Mb)
Interrupt:16 Base address:0x4c00
eth1 Link encap:Ethernet HWaddr 00:19:DB:CD:23:F5
inet addr:192.168.1.1 Bcast:192.168.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19286146 errors:0 dropped:0 overruns:0 frame:0
TX packets:17640978 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3798397700 (3622.4 Mb) TX bytes:3841710046 (3663.7 Mb)
Interrupt:28 Base address:0x8000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6970024 errors:0 dropped:0 overruns:0 frame:0
TX packets:6970024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:902263849 (860.4 Mb) TX bytes:902263849 (860.4 Mb)
[/console]
Есть у кого-нибудь идеи?
Unknown host localhost
[console]cat /etc/resolv.conf[/console]
[console]ns1:/etc # cat resolv.conf
search viking.spb.ru
nameserver 192.168.1.107
nameserver 217.195.66.253
nameserver 217.195.65.9
[/console]
Только что это должно дать? Не прописывать же мне свой сервер в resolv.conf первым в списке :)
Первый сервер - AD на винде, вторые два - ДНС провайдера.
[console]cat /etc/nsswitch.conf[/console]
И ищем строку hosts:
[console]hosts: files dns
networks: files dns
[/console]
У меня итак это есть. Вот полностью:
[console]ns1:/home/viking # cat /etc/nsswitch.conf
passwd: compat winbind
group: compat winbind
shadow: compat
hosts: files dns
networks: files dns
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: files winbind[/console]
Больше ни у кого нет идей?
в /etc/hosts добавте первой строкой
127.0.0.1 localhostвот эта строка
127.0.0.1 localhost.lan localhostдолжна быть второй, это алиас.
и /sbin/route -ne сделайте, как там с маршрутом в localhost.
PS: а в /etc/resolv.conf вообще ничего может не быть, localhost и без DNS работает (зачем ему DNS?)
в /etc/hosts добавте первой строкой text127.0.0.1 localhost
Да не меняет это ничего!
[console]
ns1:/etc # route -ne
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
217.195.83.64 0.0.0.0 255.255.255.224 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 217.195.83.65 0.0.0.0 UG 0 0 0 eth0
[/console]
а
getent hosts localhost
срабатывает?
Все, проблема решилась перезагрузкой. Видимо глюк какой-то был
Да не меняет это ничего!
меняет таки...