dnsmasq使用注意事项
来源:互联网 发布:娄烨电影知乎 编辑:程序博客网 时间:2024/06/02 20:39
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服务器上网
- 配置FindBugs和常见FindBugs错误
- Zend Framework1-Zend_Acl
- 七牛android下载文件时 url的拼接
- 不能将this指针从“const type" 转换为"type &"
- 我要做一个安静的女程序猿
- dnsmasq使用注意事项
- Linux shell笔记
- 所有浏览器打不开网页,qq能上,并且浏览器显示以停止工作
- 搭建自己的git 代码服务器
- CentOS 上 关于 SystemTap 安装
- android知识图
- Linux 文件权限之不完全解析!
- dubbo官网
- libxml2库函数详解