[ubuntu] 開発環境用にローカルでDNSサーバーを立てる

$ sudo su -
# apt-get install bind
# vi /etc/bind/named.conf.options
//以下を追記。
# ここから
forwarders {
  192.168.1.1;
};
allow-query{
  localhost;
};
# ここまで
# vi /etc/bind/db.local
test    IN      A       127.0.0.1 #追加
test    IN      MX  10  test # 追加
# /etc/init.d/bind restart
# dig @localhost test.localhost 
; <<>> DiG 9.3.4 <<>> @localhost test.localhost
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46625
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;test.localhost.                        IN      A

;; ANSWER SECTION:
test.localhost.         604800  IN      A       127.0.0.1

;; AUTHORITY SECTION:
localhost.              604800  IN      NS      localhost.

;; ADDITIONAL SECTION:
localhost.              604800  IN      A       127.0.0.1
;; Query time: 42 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Sep 16 21:29:04 2007
;; MSG SIZE  rcvd: 78
# vi /etc/resolv.conf
nameserver 192.168.11.150
nameserver 218.176.253.97
nameserver 127.0.0.1