CentOS 7 : Dnsmasq : Install : Server World

Hits: 453

Install Dnsmasq which is the lightweight DNS forwarder and DHCP Server Software.
[1] Install Dnsmasq.
[root@dlp ~]#

yum -y install dnsmasq
[2] Configure Dnsmasq.
[root@dlp ~]#

vi /etc/dnsmasq.conf
# line 19: uncomment (never forward plain names)

domain-needed

# line 21: uncomment (never forward addresses in the non-routed address spaces)

bogus-priv

# line 41: uncomment (query with each server strictly in the order in resolv.conf)

strict-order

# line 55: add if you need
# query the specific domain name to the specific DNS server
# the example follows means query [server.education] domain to the [10.0.0.10] server
server=/server.education/10.0.0.10
# line 123: uncomment (add domain name automatically)

expand-hosts

# line 133: add (define domain name)
domain=srv.world

[root@dlp ~]#

systemctl start dnsmasq

[root@dlp ~]#

systemctl enable dnsmasq
[3] For DNS records, add them in /etc/hosts.
Then, Dnsmasq will answer to queries from clients.
[root@dlp ~]#

vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
# add records
10.0.0.30   dlp.srv.world dlp 

[root@dlp ~]#

systemctl restart dnsmasq
[4] If Firewalld is running, allow DNS service.
[root@dlp ~]#

firewall-cmd –add-service=dns –permanent

success
[root@dlp ~]#

firewall-cmd –reload

success

Install Dnsmasq which is the lightweight DNS forwarder and DHCP Server Software. [1] Install Dnsmasq. [root@dlp ~]# yum -y install dnsmasq [2] Configure Dnsmasq. [root@dlp ~]# vi /etc/dnsmasq.conf # line 19: uncomment (never forward plain names) domain-needed # line 21: uncomment (never forward addresses in the non-routed address spaces) bogus-priv # line 41: uncomment (query with each server strictly in the order in resolv.conf) strict-order # line 55: add if you need # query the specific domain name to th

Source: CentOS 7 : Dnsmasq : Install : Server World