Comments (1)
找到原因了,不是dnsmasq的问题。
由于上级是用广电的dns服务器。
我在内网使用了ipv6双栈。
出现的问题是,就是偶然、随机的打不开网页,提示是dns不能解析。
用wireshack抓包发现:打开网页时,windows会发现两个dns请求,一个是请求AAAA记录。第二个是A记录。
因为很多域名是没有ipv6地址的,于是dns先返回一个NXDOMAIN AAAA,再返回一个正常的A记录。于是浏览器误以为没有这个域名了。
开始以为是dnsmasq的问题,放狗搜索,了解 dnsmasq已经解决这个bug.
有关链接在:
NODATA-reply on AAAA-CNAME-queries where no A-record exists
打开tcpdump,直接抓上级服务器返回的dns包。结果发现,是上级dns的原因。因为上级dns直接返回了NXDOMAIN的AAAA记录,下级的dnsmasq当然是照单全转了。
找到了病因,就要从dnsmsq中下手了,办法就是:把dnsmasq 返回的NXDOMAIN AAAA记录,修改为NODATA。让windows不再误会。
看源码看了n久。最终。
修改src/forward.c,在process_reply函数中
在
if (extract_addresses(header, n, daemon->namebuff, now, sets, is_sign, check_rebind, no_cache, cache_secure, &doctored))
前面添加:
if (RCODE(header) == NXDOMAIN &&
extract_request(header, n, daemon->namebuff, NULL) == F_IPV6 )
{
munged = 1;
header->hb3 |= HB3_AA;
SET_RCODE(header, NOERROR);
cache_secure = 0;
}
大功告成。
from dnsmasq.
Related Issues (20)
- 实测跟石像鬼严重冲突 HOT 3
- 为特定域指定的上游会同时应用到根域 HOT 1
- 开启缓存时 --proxy-dnssec 仅作用于首次查询 HOT 1
- 当没有设置默认上游的时候会出现非常严重的问题! HOT 2
- option --all-servers seem is not effect
- please update root-zone trust-anchors in trust-anchors.conf file HOT 1
- 小米路由器 R2D dnsmasq的DNS解析无法使用
- 启用fastdnsmasq后services.googleapis.cn网站会被解析到国内被劫持的ip上 HOT 1
- 请教一个域名能否同时添加到2个ipset列表里?
- precompiled packages for Lede HOT 1
- v2ray每天不定时断线 HOT 3
- dnsmasq: failed to create listening socket for port 53: Permission denied HOT 4
- 老哥,all-servers参数无效 HOT 13
- ipfs.io的ipk包下载不了,请求重新上传 HOT 1
- how to disabled ipv6 HOT 1
- 请问能否再联系一下dnsmasq的原作者,把这个patch merge到今后的更新? HOT 9
- lede下编译出错 HOT 1
- fastlookup 2.77 test HOT 5
- 一启用这个gfwlist,过会儿就都无法上网了,用原版不会 HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnsmasq.