歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS6安裝DNSmasq

CentOS6安裝DNSmasq

日期:2017/3/6 9:46:32   编辑:學習Linux

CentOS6安裝DNSmasq


CentOS6安裝DNSmasq


創建用戶

useradd -r -g users dnsmasq

安裝DNSmasq

yum install -y gcc

wgethttp://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

修改配置文件

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#域名解析文件

編輯域名解析文件

echo "192.168.238.135 www.examp;e.com" >> /etc/hosts

啟動

/usr/local/sbin/dnsmasq

檢查DNSmasq是否啟動成功,如果53端口已成功啟動,則說明DNSmasq已經正常工作。

[root@localhost ~]# 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

http://xxxxxx/Linuxjc/1134283.html TechArticle

Copyright © Linux教程網 All Rights Reserved