3

Ubuntu15.10 の新規インストール後、私のコマンド (ping、ssh、...) は、nslookup、host、dig によって解決された IP アドレスとは異なる IP アドレスを使用しています...これはどのように起こりますか?

user@ubuntu-15-10:~$ nslookup foobar.com
 Server:        127.0.1.1
 Address:   127.0.1.1#53

 Non-authoritative answer:
 foobar.com canonical name = foobar.homeip.net.
 Name:  foobar.homeip.net
 Address: 12.34.56.78

user@ubuntu-15-10:~$ host foobar.com
 foobar.com is an alias for foobar.homeip.net.
 foobar.homeip.net has address 12.34.56.78

user@ubuntu-15-10:~$ ping foobar.com
 PING foobar.com (192.168.1.3) 56(84) bytes of data.
 64 bytes from foobar.localdomain.home (192.168.1.3): icmp_seq=1 ttl=64 time=0.245 ms
 64 bytes from foobar.localdomain.home (192.168.1.3): icmp_seq=2 ttl=64 time=0.285 ms
 64 bytes from foobar.localdomain.home (192.168.1.3): icmp_seq=3 ttl=64 time=0.269 ms
 ^C
 --- foobar.com ping statistics ---
 3 packets transmitted, 3 received, 0% packet loss, time 2000ms
 rtt min/avg/max/mdev = 0.245/0.266/0.285/0.021 ms

user@ubuntu-15-10:~$

私の /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 127.0.1.1
search localdomain.home

私の /etc/nsswitch.conf

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] wins dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

/etc/hosts に foobar.com のエントリがありません

誰でもアイデアはありますか?

4

2 に答える 2

2

調査の結果、修正 myslef が見つかりました... 問題は /etc/nsswitch.conf にありました:「hosts」行:「dns」エントリは「wins」エントリの前にある必要があります...背後にあるものはわかりませんが、今では期待どおりに動作します

于 2015-11-15T17:58:06.957 に答える