LoginSignup
3
3

More than 5 years have passed since last update.

ubuntu 15.10 における resolvconf まわりの初期設定

Last updated at Posted at 2016-05-01

私の環境だと、 ubuntu 15.10 におけるデフォルトの resolvconf 設定だと、
頻繁に google.com の名前解決ができなくなる現象が発生した。

これを解決するために、以下を実施した。

  • eth0 に固定アドレスを設定
  • /etc/avahi/avahi-daemon.conf の domain-name の箇所を domain-name=.alocal と修正
  • /etc/nsswitch.conf を修正
  • /etc/NetworkManager/NetworkManager.confdns=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.confdns=dnsmasq をコメントアウト

dns=dnsmasq をコメントアウト。

Trouble Shooting

"ping: unknown host google.com" but IP's works fine

の時は resolvconf を入れなおした。

sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf

References

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3