Всем привет, есть сервер под убунтой
# uname -a
Linux turbine 2.6.31-23-server #74-Ubuntu SMP Mon Feb 28 22:32:34 UTC 2011 x86_64 GNU/Linux
Проблема в том что он не резолвит локальные адреса которые с других машин резолвятся на отлично!
[console]root@turbine:~# ping thecus.somecom.local
ping: unknown host thecus.somecom.local
root@turbine:~# ^C
root@turbine:~# ping google.com
PING google.com (74.125.232.52) 56(84) bytes of data.
64 bytes from 74.125.232.52: icmp_seq=1 ttl=54 time=64.1 ms
64 bytes from 74.125.232.52: icmp_seq=2 ttl=54 time=68.1 ms
64 bytes from 74.125.232.52: icmp_seq=3 ttl=54 time=63.4 ms
^C64 bytes from 74.125.232.52: icmp_seq=4 ttl=54 time=63.0 ms
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 15317ms
rtt min/avg/max/mdev = 63.016/64.680/68.116/2.044 ms
root@turbine:~# dig google.com
; <<>> DiG 9.6.1-P2 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60389
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 0
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 264 IN A 74.125.232.51
google.com. 264 IN A 74.125.232.52
google.com. 264 IN A 74.125.232.48
google.com. 264 IN A 74.125.232.49
google.com. 264 IN A 74.125.232.50
;; AUTHORITY SECTION:
google.com. 171869 IN NS ns2.google.com.
google.com. 171869 IN NS ns3.google.com.
google.com. 171869 IN NS ns4.google.com.
google.com. 171869 IN NS ns1.google.com.
;; Query time: 0 msec
;; SERVER: 192.168.2.9#53(192.168.2.9)
;; WHEN: Thu Jun 9 14:06:20 2011
;; MSG SIZE rcvd: 180
root@turbine:~# nslookup google.com
Server: 192.168.2.9
Address: 192.168.2.9#53
Non-authoritative answer:
Name: google.com
Address: 74.125.232.50
Name: google.com
Address: 74.125.232.51
Name: google.com
Address: 74.125.232.52
Name: google.com
Address: 74.125.232.48
Name: google.com
Address: 74.125.232.49
root@turbine:~# ping 192.168.2.9
PING 192.168.2.9 (192.168.2.9) 56(84) bytes of data.
64 bytes from 192.168.2.9: icmp_seq=1 ttl=64 time=0.162 ms
64 bytes from 192.168.2.9: icmp_seq=2 ttl=64 time=0.151 ms
64 bytes from 192.168.2.9: icmp_seq=3 ttl=64 time=0.137 ms
^C
--- 192.168.2.9 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2007ms
rtt min/avg/max/mdev = 0.137/0.150/0.162/0.010 ms
[/console]
С другой машины в этой же сети:
[console][root@centos ~]# ping thecus.somecom.local
PING thecus.somecom.local (192.168.2.211) 56(84) bytes of data.
64 bytes from 192.168.2.211: icmp_seq=1 ttl=64 time=1.08 ms
64 bytes from 192.168.2.211: icmp_seq=2 ttl=64 time=0.134 ms
[/console]
Причем что самое интересное:
[console]root@turbine:~# ping thecus.somecom.local
ping: unknown host thecus.somecom.local
root@turbine:~# dig thecus.somecom.local
; <<>> DiG 9.6.1-P2 <<>> thecus.somecom.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7505
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;thecus.somecom.local. IN A
;; ANSWER SECTION:
thecus.somecom.local. 1200 IN A 192.168.2.211
;; AUTHORITY SECTION:
somecom.local. 1200 IN NS ns1.somecom.local.
;; ADDITIONAL SECTION:
ns1.somecom.local. 1200 IN A 192.168.2.9
;; Query time: 0 msec
;; SERVER: 192.168.2.9#53(192.168.2.9)
;; WHEN: Thu Jun 9 13:53:39 2011
;; MSG SIZE rcvd: 86
root@turbine:~# nslookup thecus.somecom.local
Server: 192.168.2.9
Address: 192.168.2.9#53
Name: thecus.somecom.local
Address: 192.168.2.211
[/console]
Локальное имя прекрасно определяется... Что за гвозди не могу понять!
Так же неполучается использовать локальные имена в других сервисах, таких как ssh.
Чтобы избежать вопросов
[console]
root@turbine:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@turbine:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet manual
dns-nameserver 192.168.2.9
auto br0
iface br0 inet static
address 192.168.2.7
network 192.168.2.0
netmask 255.255.255.0
broadcast 192.168.2.255
gateway 192.168.2.1
dns-nameserver 192.168.2.9
#dns-nameservers 192.168.0.1 192.168.0.2
dns-search somecom.local
# dns-nameservers 192.168.2.9
bridge_ports eth0
bridge_stp on
bridge_fd 0
bridge_maxwait 0
[/console]
Стояла утилита resolvconf думал проблема в ней, выкосил. убедился что в файле resolv.conf прописан нужный IP
[console]root@turbine:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.2.9[/console]
LinuxForum.Fans
Проблема "Could not resolve hostname" с локальными именами
Автор: ufomen
3 сообщений
5403 просмотров
для .local нужен Avahi, там подковырять надо немного что бы он заработал.
А именно разрешить работать на компе который сам в зоне\сети .local
в /etc/nsswitch.conf
в строке
files mdns4_minimal [NOTFOUND=return] dns mdns4
убрать опцию [NOTFOUND=return]
и он будет искать сервисы зоны .local
но такое ощущение, что я че то не понял в вопросе или что то перепутал
для .local нужен Avahi, там подковырять надо немного что бы он заработал.
А именно разрешить работать на компе который сам в зоне\сети .local
в /etc/nsswitch.conf
в строке
files mdns4_minimal [NOTFOUND=return] dns mdns4
убрать опцию [NOTFOUND=return]
и он будет искать сервисы зоны .local
но такое ощущение, что я че то не понял в вопросе или что то перепутал
Только заметил Ваш ответ почему-то, да! Все заработало. Огромное спасибо! В жизни б не подумал, что все это связано с Avahi...
Войдите или зарегистрируйтесь, чтобы ответить.