[App] dnsmasq 安装
2017-10-12 16:34
246 查看
# yum -y install 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 安装
- 安卓app开发之Basic4android软件安装配置以及常见错误
- Android APP安装后不在桌面显示图标的应用场景举例和实现方法
- xml bug 当重新安装app的时候跳转到端口不同
- AppScan安装时出现错误1603
- 请教一下,我开发的ios app发布到appstore之后,在ios 8.0.2 iphone6 plus上下载总提示安装失败,又要重新安装
- 为什么App安装要做个性化
- iPhone、iPad 通过网站实现一键安装 ipa 格式的 APP 应用
- Android安装和删除(卸载)应用软件程序(apk/app)
- Linux APP源码级编译安装
- android开发 判断app是否是第一次安装
- iOS:苹果企业证书通过网页分发安装app
- AppScan安全扫描工具之安装及配置GlassBox
- [App] rhel7 下 安装 JBoss7
- app的升级安装,解决6.0,7.0问题
- android studio运行安装后,手机上出现两个相同的App图标
- scrapy-redis(八):安装scrapy监控app--graphite
- android 安装apk 到 /system/app下面
- 又到周末了,我们一起来研究【浏览器如何检测是否安装app】吧