dnsmasq
5:52 am
BINDでDNSを構築するまでもない、小規模LANに最適なhostsベースなDNSサーバがDnsmasqです。
設定ファイル /etc/dnsmasq.conf を以下のように変更しました。
二つのドメインをセットしてみました。xはそれぞれの環境に合わせてセットします。
listen-address=127.0.0.1 domain=hbirds.homelinux.com domain=hubuntu.net dhcp-host=00:xx:xx:xx:xx:xx,192.168.xxx.xxx log-queries log-facility=/var/log/dnsmasq
$ sudo /etc/init.d/dnsmasq restart
$ dig @127.0.0.1 hbirds.homelinux.comとすると、以下のようになります。
hbirds@UbuntuServer:~$ dig @127.0.0.1 hbirds.homelinux.com ; <<>> DiG 9.6.1-P2 <<>> @127.0.0.1 hbirds.homelinux.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24675 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;hbirds.homelinux.com. IN A ;; ANSWER SECTION: hbirds.homelinux.com. 0 IN A 192.168.0.4 ;; Query time: 2 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Mar 22 05:43:59 2010 ;; MSG SIZE rcvd: 54
$ dig @127.0.0.1 hubuntu.netとすると、以下のようになります。
hbirds@UbuntuServer:~$ dig @127.0.0.1 hubuntu.net ; <<>> DiG 9.6.1-P2 <<>> @127.0.0.1 hubuntu.net ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40315 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;hubuntu.net. IN A ;; ANSWER SECTION: hubuntu.net. 0 IN A 192.168.0.4 ;; Query time: 2 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Mar 22 05:45:15 2010 ;; MSG SIZE rcvd: 45
$ sudo cat /var/log/dnsmasqにより、ログを見ると、以下のようになってます。
Mar 22 05:43:59 dnsmasq[1973]: query[A] hbirds.homelinux.com from 127.0.0.1 Mar 22 05:43:59 dnsmasq[1973]: /etc/hosts hbirds.homelinux.com is 192.168.0.4 Mar 22 05:45:15 dnsmasq[1973]: query[A] hubuntu.net from 127.0.0.1 Mar 22 05:45:15 dnsmasq[1973]: /etc/hosts hubuntu.net is 192.168.0.4
単にhostsを読みにいって、名前解決しているだけのように見えますが、これでいいのかな。
Related Posts
No Comments »
RSS feed for comments on this post. TrackBack URL
Leave a comment
You must be logged in to post a comment.