Jalena Blog

  • 首页
  • 程序开发
    • Java
    • Spring
    • SpringBoot
    • SpringMvc
    • Python
    • Odoo
    • C#
    • SQL
    • Web
    • Linux
  • 移动设备
    • Android
    • Router
  • 杂七杂八
    • 我的废话
    • 音频
    • 视频
    • 常用软件
  • 关于
  1. 首页
  2. 杂七杂八
  3. 正文

DnsMasq 参数

2014-12-17
cat /etc/dnsmasq.conf
# 不读取任何服务器 默认 /etc/resolv.conf 可以使用resolv-file自定义
# 使用resolv-file时候也不能使用no-resolv参数
#no-resolv
#server=222.85.85.85
#server=222.88.88.88
#server=8.8.8.8

bogus-priv
#不转发不包含.的查询 因为这些一般都是内网查询
domain-needed
#为早期windows系统设置的兼容选项,避免客户端接收不到公共DNS而弹出新建宽带连接
filterwin2k

#指定DNS服务器

resolv-file=/etc/dnsmasq.resolv.conf
#查询时按文件中的顺序选择dns
strict-order
#添加本地hosts文件
addn-hosts=/etc/dnsmasq.hosts.conf
#不读取hosts文件 默认/etc/hosts 可以使用addn-hosts自定义
#如果不加no-hosts还是会读取/etc/hosts
no-hosts
#注:addn-hosts=/etc/dnsmasq.hosts的优先级大于address=/domain.name/127.0.0.1

#设置缓存条目 如果不缓存使用no-negcache
cache-size=102400
#丢弃并记录域名服务器返回的私有IP地址,防止探测内网的机器
#由于目前部分地址还是使用私有的 所以暂时不起用
#stop-dns-rebind
#允许客户端缓存的时间单位为秒
local-ttl=60
#
neg-ttl=3600
#
max-cache-ttl=600

# 配置日志
log-facility=ar/log/dnsmasq.log
#记录DNS查询
log-queries

# 引入其他配置文件
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d

最后附上一个host转为dnsmasq的方式

awk '$1 ~ /^[0-9]/ {printf("address=/%s/%s\n", $2,$1)}' /etc/google.host | sed -e '/Xiao/d' -e '/^$/d' > /etc/dnsmasq.host
标签: DNSMasq
最后更新:2019-02-10

Jalena

原创内容,转载请注明出处! 部分内容来自网络,请遵守法律适用!

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

【腾讯云】云服务器特惠热卖中
标签聚合
java Centos odoo 其他 生活 wordpress docker MySql
分类
  • Android / 4篇
  • C# / 10篇
  • Codec / 9篇
  • Conversion / 14篇
  • Editing / 16篇
  • Java / 47篇
  • Javascript / 3篇
  • Linux / 30篇
  • Odoo / 25篇
  • Python / 6篇
  • SQL / 30篇
  • Web / 3篇
  • Windows / 4篇
  • 我的日记 / 10篇
  • 杂七杂八 / 93篇
  • 软件开发 / 72篇
  • 非线性编辑 / 1篇

COPYRIGHT © 2026 Jalena Blog. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蜀ICP备17025376号