ubuntu 15.10 における resolvconf まわりの初期設定
私の環境だと、 ubuntu 15.10 におけるデフォルトの resolvconf 設定だと、 頻繁に google.com の名前解決ができなくなる現象が発生した。
これを解決するために、以下を実施した。
- eth0 に固定アドレスを設定
/etc/avahi/avahi-daemon.conf
の domain-name の箇所をdomain-name=.alocal
と修正/etc/nsswitch.conf
を修正/etc/NetworkManager/NetworkManager.conf
のdns=dnsmasq
をコメントアウト
eth0 に固定アドレスを設定
eth0 に固定アドレスを設定するようにした。
(/etc/network/interfaces
, /etc/resolvconf/resolv.conf/base
などを設定した)
例:
- /etc/network/interfaces
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.11.2 netmask 255.255.255.0 gateway 192.168.11.1 dns-servers 8.8.8.8 8.8.4.4
結果として、 /etc/resolv.conf
が生成される
設定を有効にするには、 resolvconf
コマンドを実行すれば良い。
$ sudo resolvconf -u
/etc/avahi/avahi-daemon.conf
を修正
/etc/avahi/avahi-daemon.conf
の # domain-name=local
の箇所に、
domain-name=.alocal
と追記。
/etc/nsswitch.conf
を修正
/etc/nsswitch.conf
の次の箇所を修正する。
変更前:
files mdns4_minimal [NOTFOUND=return] dns mdns4
変更後:
files dns
/etc/NetworkManager/NetworkManager.conf
の dns=dnsmasq
をコメントアウト
dns=dnsmasq
をコメントアウト。
Trouble Shooting
の時は resolvconf
を入れなおした。
sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf
References
- http://www.tecmint.com/set-static-ip-address-in-ubuntu-15-10-server/
- http://www.asterisk-works.jp/wiki/index.php/%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC%E3%82%AF%E8%A8%AD%E5%AE%9A(Ubuntu)
- http://d.hatena.ne.jp/zzkater/20140713/1405250096
- http://askubuntu.com/questions/368435/how-do-i-fix-dns-resolving-which-doesnt-work-after-upgrading-to-ubuntu-13-10-s
- http://askubuntu.com/questions/455338/ping-unknown-host-google-com-but-ips-works-fine
- http://askubuntu.com/questions/465729/ping-unknown-host-google-com-in-ubuntu-server
- https://forums.ubuntulinux.jp/viewtopic.php?id=17345
- http://stuartfeeser.com/2013/02/11/ubuntu/
http://askubuntu.com/questions/688557/after-15-10-upgrade-networkmanager-using-30-cpu
http://askubuntu.com/questions/134121/how-to-restore-recreate-etc-resolv-conf-files