gentoo のリゾルバ周りがモビリティ重視に変わってしまったようで、起動の度に /etc/resolv.conf を変更してくれます。我が家の ローカルネット上に存在しているファイルサーバでは DNS を使用することはなく、プロバイダの DNS に聞きに行くという運用をやっていたのだけど、上記の /etc/resolv.conf の生成の度(再起動の度)に nameserver の項目が欠落するということが起きていた。
/etc/conf/net.example や /etc/init.d/net.lo を読むと、そのとき繋いでる AP 等に応じて resolv.conf を動的に生成するフレームワークが導入されたようなのですが、固定アドレス振ってるサーバの resolv.conf も動的生成してくれちゃうという問題が発生するようになってしまった。
/etc/conf/net.example
を見る限りでは、
# You can also override any settings found here per MAC address of the AP
# in case you use Access Points with the same ESSID but need different
# networking configs. Below is an example – of course you use the same
# method with other variables
#mac_config_001122334455=( “dhcp” )
#mac_dhcpcd_001122334455=”-t 10″
#mac_dns_servers_001122334455=( “192.168.0.1″ “192.168.0.2″ )
のように記載されていて、DHCP サーバの MAC アドレス毎に DNS サーバを選択出来るようにはなっているのですが、何も考えない(クラシカルな) resolv.conf の書き方が解らなくなってしまった。
いろいろ調べて見ると
emrege net-dns/resolvconf-gentoo
をした上で、
/etc/resolvconf/resolv.conf.d/tail
にでも nameserver 項目を書いておけば良さそうだと言うことが判明。
奥が深い。というか、場当たり的でスマートじゃない解決方法だなぁ。
本当はどうするのがスマートなんだろう。
2/3 追記
# To use dns settings such as these, dns_servers_eth0 must be set!
# If you omit the _eth0 suffix, then it applies to all interfaces unless
# overridden by the interface suffix.
#dns_domain_eth0=”your.domain”
#dns_servers_eth0=”192.168.0.2 192.168.0.3″
#dns_search_eth0=”this.domain that.domain”
#dns_options_eth0=( “timeout 1″ “rotate” )
#dns_sortlist_eth0=”130.155.160.0/255.255.240.0 130.155.0.0″
# See the man page for resolv.conf for details about the options and sortlist
# directives
という、そのものな記載が有った。
そうだよね。これが一番スマートだよね。
しかし、なんでコレが AP の MAC 別記載方法の後ろに書いてあるかな。
Related posts:


:








No user commented in " gentoo-linux で resolv.conf に固定的に nameserver を記載する方法 "
コメントをフィードする comment rss / トラックバックするコメントする