Create user
Useradd-r-G users dnsmasq
Installing DNSMASQ
Yum install-y gcc
wget http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.76.tar.gz
Tar zxvf dnsmasq-2.76.tar.gz
CD dnsmasq-2.76
Make && make install
CP dnsmasq.conf.example/etc/dnsmasq.conf
Modifying a configuration file
Vi/etc/dnsmasq.conf
USER=DNSMASQ #启动账号
Group=users #启动组号
Interface=eth0 #绑定网络接口
listen-address=192.168.238.135 #绑定IP
Bind-interfaces
Resolv-file=/etc/resolv.conf #域名解析文件
Addn-hosts=/etc/hosts #域名解析文件
Edit a domain name resolution file
echo "192.168.238.135 www.examp;e.com" >>/etc/hosts
Start
/usr/local/sbin/dnsmasq
Check if the DNSMASQ is successful, and if Port 53 has been successfully started, the DNSMASQ is working correctly.
[Email protected] ~]# NETSTAT-TNL | grep 53
TCP 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
TCP 0 0 192.168.238.135:53 0.0.0.0:* LISTEN
TCP 0 0:: 1:53:::* LISTEN
TCP 0 0 fe80::20c:29ff:fe4f:fae7:53:::* LISTEN
This article is from "Love, Lynn" blog, please be sure to keep this source http://love11forever.blog.51cto.com/11313259/1783784
CentOS6 installation DNSMASQ