首先设定本机的dns:
[root@128 ~]# vim /etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain
nameserver 192.168.217.128
修改配置文件:
[root@128 ~]# vim /etc/named.conf
options {
listen-on port 53 { any; };
// listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
添加正向解析:
[root@128 ~]# vim /etc/named.rfc1912.zones
zone "extmail.com" IN {
type master;
file "extmail.com.zone";
};
添加正向解库文件;
[root@128 ~]# vim /var/named/extmail.com.zone

完成,测试:
[root@128 ~]# dig -t -A www.extmail.com
;; Warning, ignoring invalid type -A
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.47.rc1.el6_8.2 <<>> -t -A www.extmail.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 15939
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.extmail.com. IN A
;; Query time: 1 msec
;; SERVER: 192.168.217.128#53(192.168.217.128)
;; WHEN: Wed Nov 2 03:09:46 2016
;; MSG SIZE rcvd: 33