next up previous contents
Next: Dnsmasq DHCP 架設 Up: Dnsmasq server Previous: Dnsmasq 架設   Contents

Dnsmasq DNS 架設

  1. dnsmasq 主要設定檔為 /etc/dnsmasq.conf,其中 listen-address=127.0.0.1 記得要出現,否則本機無法查詢 dnsmasq。 mx-host 則是設定網域內主機的郵件 MX 識別。
    [root@dywnb ~]# vim /etc/dnsmasq.conf
    listen-address=192.168.122.1
    listen-address=127.0.0.1
    [root@dywnb ~]# egrep -v '(^\ *$|#)' /etc/dnsmasq.conf
    listen-address=192.168.122.1
    listen-address=127.0.0.1
    mx-host=deyu.wang,10
    mx-host=kvm1.deyu.wang,20
    mx-host=kvm2.deyu.wang,20
    mx-host=kvm3.deyu.wang,20
    mx-host=kvm4.deyu.wang,20
    mx-host=kvm5.deyu.wang,20
    mx-host=kvm6.deyu.wang,20
    mx-host=kvm7.deyu.wang,20
    mx-host=kvm8.deyu.wang,20
    mx-host=kvm9.deyu.wang,20
    mx-host=kvm10.deyu.wang,20
    
  2. 將要設定的查詢加到 /etc/hosts。
    [root@dywnb ~]# grep deyu.wang /etc/hosts
    192.168.1.110	oveng.deyu.wang
    192.168.122.1	deyu.wang
    192.168.122.1	server.deyu.wang
    192.168.122.2	kvm2.deyu.wang
    192.168.122.2	www2.deyu.wang
    192.168.122.2	dynamic2.deyu.wang
    ......................
    



2018-04-25