CentOS 6.x 安装DNS服务简明过程
一、安装dnsmasq
1.安装dnsmasq
# yum install dnsmasq bind-utils
2.配置dnsmasq
# cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
添加以下到/etc/dnsmasq.conf
no-resolv
server=127.0.0.1
domain=domain.com
mx-host=domain.com,mail.domain.com,5
添加以下到/etc/resolv.conf
nameserver 127.0.0.1
启动dnsmasq
# /etc/init.d/dnsmasq start
测试:
[root@mail ~]# dig domian.com MX
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> domain.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38013
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;domain.com. IN MX
;; ANSWER SECTION:
domain.com. 0 IN MX 5 mail.domain.com.
;; ADDITIONAL SECTION:
mail.domain.com. 0 IN A 10.172.250.121
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Oct 22 14:20:02 2014
;; MSG SIZE rcvd: 73
[root@mail ~]#
测试成功。