Centos 6.4 安装dnsmasq的方法
<p><strong>1 下载源码</strong></p><div class="jb51code">
<pre class="brush:bash;">wget http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.45.tar.gz
cp dnsmasq-2.45.tar.gz /usr/src
tar zxvf dnsmasq-2.45.tar.gz</pre>
</div>
<p><strong>2 编译安装</strong></p>
<div class="jb51code">
<pre class="brush:bash;">cd /usr/src/dnsmasq-2.45
make install
cp dnsmasq.conf.example /etc/dnsmasq.conf
mkdir -p /etc/dnsmasq.d</pre>
</div>
<p><strong>3 配置</strong> </p>
<div class="jb51code">
<pre class="brush:bash;">vi /etc/dnsmasq.conf
##########
resolv-file=/etc/dnsmasq.d/dnsmasq.resolv.conf
strict-order
listen-address= 192.168.1.xx
addn-hosts=/etc/dnsmasq.d/dnsmasq.hosts</pre>
</div>
<p>在/etc/dnsmasq.d目录下新建2个文件 <br /><br />dnsmasq.resolv.conf</p>
<div class="jb51code">
<pre class="brush:plain;">nameserver 8.8.8.8</pre>
</div>
<p>dnsmasq.hosts</p>
<div class="jb51code">
<pre class="brush:plain;">ipdomain</pre>
</div>
<p><strong>4 安装dig&nslookup</strong> <br /><br />Ubuntu:</p>
<div class="jb51code">
<pre class="brush:bash;">sudo apt-get install dnsutils</pre>
</div>
<p>Fedora / Centos:</p>
<div class="jb51code">
<pre class="brush:bash;">yum install bind-utils</pre>
</div>
頁:
[1]