Skip to content

Instantly share code, notes, and snippets.

@mlicheng
Created February 6, 2021 07:37
Show Gist options
  • Save mlicheng/9f4df3083c6cb18a82cc4402f87ddd2e to your computer and use it in GitHub Desktop.
Save mlicheng/9f4df3083c6cb18a82cc4402f87ddd2e to your computer and use it in GitHub Desktop.
dnsmasq config with ad statistic block
## /usr/local/etc/dnsmasq.conf
listen-address=127.0.0.1
# nameserver 119.29.29.29
# nameserver 223.5.5.5
# nameserver 1.1.1.1
# nameserver 114.114.114.114
# statistic
address=/bshare.cn/0.0.0.0
address=/bashare.cn/0.0.0.0
address=/3001.net/0.0.0.0
address=/pic.x.soso.com/0.0.0.0
address=/51.la/0.0.0.0
address=/umeng.com/0.0.0.0
address=/cnzz.com/0.0.0.0
address=/tajs.qq.com/0.0.0.0
address=/pingma.qq.com/0.0.0.0
address=/nsclick.baidu.com/0.0.0.0
address=/doubleclick.net/0.0.0.0
address=/beacon.sina.com.cn/0.0.0.0
address=/sax.sina.cn/0.0.0.0
no-hosts
server=/google.com/8.8.8.8
server=/simtoco.com/180.76.76.76
# 缓存大小,默认是150,最大9999
cache-size=3000
#增大缓存在本地的时间,减少请求次数。最大3600
min-cache-ttl=3600
#重新加载后清空缓存
clear-on-reload
#dnsmasq日志设置
log-queries
log-facility=/var/log/dnsmasq.log
# sudo brew services restart dnsmasq
# sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
# chrome://net-internals/#dns
@mlicheng
Copy link
Author

mlicheng commented Feb 6, 2021

test for is dnsmasq worked
ping -c 1 umeng.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment