dnsmasq 装配
dnsmasq 安装
在192.168.0.133机器上操作 rpm -qa dnsmasq dnsmasq-2.45-1.1.el5_3 如果不存在 yum install dnsmasq 安装完成后 cp /etc/resolv.conf /etc/resolv.dnsmasq.conf vi /etc/dnsmasq.conf resolv-file=/etc/resolv.dnsmasq.conf vi /etc/dnsmasq.d/xxx.conf(名字随便取) address=/test.test.feng.com/192.168.0.133 vi /etc/resolv.conf nameserver 192.168.0.133 [root@QA_Server81 logs]# dig www.baidu.com ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> www.baidu.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14517 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.baidu.com. IN A ;; ANSWER SECTION: www.baidu.com. 1079 IN CNAME www.a.shifen.com. www.a.shifen.com. 68 IN A 111.13.100.91 www.a.shifen.com. 68 IN A 111.13.100.92 ;; Query time: 37 msec ;; SERVER: 114.114.114.114#53(114.114.114.114) ;; WHEN: Fri Aug 30 17:30:17 2013 ;; MSG SIZE rcvd: 90 You have new mail in /var/spool/mail/root [root@rycdb dnsmasq.d]# ping test.test.feng.com PING test.test.feng.com (192.168.0.133) 56(84) bytes of data. 64 bytes from rycdb (192.168.0.133): icmp_seq=1 ttl=64 time=0.020 ms 64 bytes from rycdb (192.168.0.133): icmp_seq=2 ttl=64 time=0.023 ms --- test.test.feng.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.020/0.021/0.023/0.004 ms