[App] dnsmasq 安装
2017-10-12 16:31
134 查看
# yum -yinstall dnsmasq bind-utils
# vi
/etc/dnsmasq.conf
# vi
/etc/resolv.conf
# vi
/etc/resolv.dnsmasq.conf
#
cp -a /etc/hosts /etc/dnsmasq.hosts
# chkconfig dnsmasq on
# service dnsmasq restart
# netstat-tunlp | grep 53
#
nslookup www.baidu.com #
测试
#
echo "192.168.1.128 hahahah" >> /etc/dnsmasq.hosts
# service dnsmasq restart
# nslookup 192.168.1.128
# nslookup hahahah
#
ping hahahah
PING hahahah(192.168.1.128) 56(84) bytes of data.
64 bytes fromhahahah (192.168.1.128): icmp_seq=1 ttl=64 time=0.234 ms
# vi
/etc/dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf #在resolv.dnsmasq.conf读取上级dns服务器地址 strict-order #按照recolv-file文件中的地址顺序获取ip address=/www.mazhihua.com/192.168.1.127 #自定义域名解析为 192.168.1.127 listen-address=127.0.0.1,192.168.1.127 #定义dnsmasq监听的地址,局域网中使用需添加局域网地址 addn-hosts=/etc/dnsmasq.hosts #定义host文件 |
# vi
/etc/resolv.conf
nameserver 127.0.0.1 # 使用本地dns |
# vi
/etc/resolv.dnsmasq.conf
nameserver 192.168.1.1 # 真实DNS地址 |
#
cp -a /etc/hosts /etc/dnsmasq.hosts
# chkconfig dnsmasq on
# service dnsmasq restart
# netstat-tunlp | grep 53
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1467/dnsmasq tcp 0 0 :::53 :::* LISTEN 1467/dnsmasq udp 0 0 0.0.0.0:53 0.0.0.0:* 1467/dnsmasq udp 0 0 :::53 :::* 1467/dnsmasq |
#
nslookup www.baidu.com #
测试
Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: www.baidu.com canonical name = www.a.shifen.com. Name: www.a.shifen.com Address: 111.13.100.91 Name: www.a.shifen.com Address: 111.13.100.92 |
#
echo "192.168.1.128 hahahah" >> /etc/dnsmasq.hosts
# service dnsmasq restart
# nslookup 192.168.1.128
Server: 127.0.0.1 Address: 127.0.0.1#53 128.1.168.192.in-addr.arpa name = hahahah. |
Server: 127.0.0.1 Address: 127.0.0.1#53 Name: hahahah Address: 192.168.1.128 |
#
ping hahahah
PING hahahah(192.168.1.128) 56(84) bytes of data.
64 bytes fromhahahah (192.168.1.128): icmp_seq=1 ttl=64 time=0.234 ms
相关文章推荐
- [App] dnsmasq 安装
- AndroidStudio如何安装app到不同手机或者模拟器上
- Mac下安装未认证的App
- ios:给appstore评分和进入app安装页面代码
- ios应用增加给appstore评分和进入app安装页面代码功能
- [IOS]企业发布无线安装APP
- iOS 7.1使用企业应用部署方式无法安装app(2014-09-13更新:dropbox被墙后的解决方案)
- [App] rhel7 下 安装 JBoss7
- app安装完成和卸载完成监听
- iOS获取app已安装列表和安装app
- ios判断手机中是否安装了某个App
- APP安装支持安装到SDCard
- Android 安装app显示已经安装 需要卸载,实际没有安装的一种解决办法
- Android app 安装目录知识
- Android6.0关于预置三方app卸载(二) 调用接口安装
- runtime直接获取自己手机上已经安装app的bundle id
- 小胖说事50-----IOS 检测APP是否在手机上安装并且打开APP
- Google将惩罚大面积展示APP应用安装广告的网站
- IOS企业App应用的安装及https证书生成
- 使用adb命令安装、卸载APP