CentOS安装DNSmasq
安装
使用yum直接安装
yum install dnsmasq -y编译安装
从
http://www.thekelleys.org.uk/dnsmasq/
下载源码包编译安装
解压后进入目录make && make install就行
配置
创建配置文件
可以把系统里配置文件复制一份使用:
cp /etc/resolv.conf /etc/dnsmasq.resolv.conf
cp /etc/hosts /etc/dnsmasq.hosts修改/etc/dnsmasq.conf
添加内容
resolv-file=/etc/dnsmasq.resolv.conf
addn-hosts=/etc/dnsmasq.hosts运行
使用chkconfig设置开机启动
chkconfig dnsmasq on启动DNSmasq
/etc/init.d/dnsmasq start