dnsmasq使用注意事项
来源:互联网 发布:如何选购家具 知乎 编辑:程序博客网 时间:2024/06/05 06:03
DNS服务器,linux下一般用bind,但bind太复杂了,dnsmasq使用上比dns始祖bind要简便得多,可以做正向dns代理,也可以直接做内部纯dns服务器用。
默认配置下,dnsmasq使用系统的/etc/resolv.conf并读取/etc/hosts,
/etc/resolv.conf文件是用来配置上一级DNS
/etc/hosts文件是用来存储dns代理缓存。
dnsmasq可以用hosts文件来设置域名:
例:mail.bingo.com是不存在的域名,在dnsmasq中指向到一个ip里,
vi /etc/hosts来添加ip,
192.168.9.199 mail.bingo.com
重启: pkill -9 dnsmasp && /usr/local/sbin/dnsmasq -h
或者 service dnsmasq restart
对外提供dns
vi /etc/dnsmasq.conf
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=
用于设置上级dns服务器,用于向上级服务器转发查询请求。不设置,默认使用/etc/resolv.conf
如要解析外网的dns,必须设置此项用于向外转发dns请求。
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d
去掉这行的注释,用于包含配置文件目录
然后保存
在/etc/dnsmasq.d 新建文件配置文件,文件名随便,例如dns-hosts.conf
添加
address=/mail.bingo.com/192.168.9.199
重启dnsmasq,然后在其他的pc测试
添加范域名的配置
address=/.google.com/203.208.37.0
address=/www.youtube.com/203.208.37.0
还有一种添加方法,
vi /etc/dnsmasq.conf
添加一行 addn-hosts=/etc/dnsmasq.hosts
然后在dnsmasq.hosts添加
192.168.9.253 www.bingo.com
然后重启dnsmasq,不过这样不支持范域名
默认配置下,dnsmasq使用系统的/etc/resolv.conf并读取/etc/hosts,
/etc/resolv.conf文件是用来配置上一级DNS
/etc/hosts文件是用来存储dns代理缓存。
dnsmasq可以用hosts文件来设置域名:
例:mail.bingo.com是不存在的域名,在dnsmasq中指向到一个ip里,
vi /etc/hosts来添加ip,
192.168.9.199 mail.bingo.com
重启: pkill -9 dnsmasp && /usr/local/sbin/dnsmasq -h
或者 service dnsmasq restart
对外提供dns
vi /etc/dnsmasq.conf
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=
用于设置上级dns服务器,用于向上级服务器转发查询请求。不设置,默认使用/etc/resolv.conf
如要解析外网的dns,必须设置此项用于向外转发dns请求。
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d
去掉这行的注释,用于包含配置文件目录
然后保存
在/etc/dnsmasq.d 新建文件配置文件,文件名随便,例如dns-hosts.conf
添加
address=/mail.bingo.com/192.168.9.199
重启dnsmasq,然后在其他的pc测试
添加范域名的配置
address=/.google.com/203.208.37.0
address=/www.youtube.com/203.208.37.0
还有一种添加方法,
vi /etc/dnsmasq.conf
添加一行 addn-hosts=/etc/dnsmasq.hosts
然后在dnsmasq.hosts添加
192.168.9.253 www.bingo.com
然后重启dnsmasq,不过这样不支持范域名
阅读全文
0 0
- dnsmasq使用注意事项
- dnsmasq使用注意事项
- libvirt的dnsmasq使用
- dnsmasq
- dnsmasq
- dnsmasq
- dnsmasq
- dnsmasq
- 使用dnsmasq作DNS服务器
- 使用dnsmasq提供DHCP服务
- 使用dnsmasq作为dns服务器
- dnsmasq在DRBL中的使用
- 使用dnsmasq提供DNS和DHCP服务
- 使用dnsmasq提供DNS和DHCP服务
- 使用dnsmasq提供DNS和DHCP服务
- 使用dnsmasq快速搭建内网DNS
- 使用dnsmasq快速搭建内网DNS
- 使用Dnsmasq搭建本地dns服务器上网
- Java之文件压缩工具类-yellowcong
- 线性表(List)---栈的顺序存储
- 超有用!原生JS实现增加删除class(addClass,removeClass,toggleClass)
- Python:对称的二叉树
- Transfer water
- dnsmasq使用注意事项
- Java之执行Windows 命令行-yellowcong
- Java之字符串工具类-yellowcong
- FTPrep, 17 letter combination of a phone number
- Java之日期工具类-yellowcong
- LuaIde 免费版本
- Java之文件工具类-yellowcong
- 调试视频教程
- Java之文件下载工具类-yellowcong