Code Monkey home page Code Monkey logo

Comments (24)

pymumu avatar pymumu commented on July 3, 2024 2

我看看修改多不多,如果不多,就加进去。

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

这个问题确实很头痛,只能期待tls1.3的SNI加密解决。

IP双栈的情况下,现在默认都是优先IPV6,所以导致这个问题。windows可以强制优先IPV4避免,但不是长久之计。

AAAA查询的情况下,只要返回SOA就表示无AAAA地址了。就看这样能否解决问题了,后续IPV6是趋势,这个可能只是暂时方案。

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

我也觉得这只能是暂时的,但至少现在,忽略某些域名的AAAA还是非常有必要的。
甚至如果v6国际带宽一直比v4低,而国内又大规模普及v6的情况下,v6上外网的体验也只会越来越差

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

增加了此功能,通过配置项
force-AAAA-SOA yes
强制停用IPV6域名。

界面没提供配置,可以在自定义配置界面手工增加配置项。

支持版本。
https://github.com/pymumu/smartdns/releases/tag/Beta14

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

@pymumu 感谢大佬。也希望能增加忽略指定域名的AAAA,这样会更灵活一点

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

感觉有bug,force-AAAA-SOA yes后,所有网页都会先是打不开,提示nxdomain什么的,过几秒才能打开,而且仅ipv4的网页也是如此

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

我家里是IPV4的网络,用起来没出现问题,可能在IPV6下有未知的一些情形。

可以执行nslookup 命令看看查询域名有没有什么问题。

这个功能是按流程来说应该没有问题的。

比如,www.baidu.com没有AAAA地址,返回的就是SOA

root@raspberrypi:/home/pi/code # dig -t AAAA www.baidu.com @8.8.8.8

; <<>> DiG 9.10.3-P4-Raspbian <<>> -t AAAA www.baidu.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24389
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.baidu.com. IN AAAA

;; ANSWER SECTION:
www.baidu.com. 264 IN CNAME www.a.shifen.com.

;; AUTHORITY SECTION:
a.shifen.com. 465 IN SOA ns1.a.shifen.com. baidu_dns_master.baidu.com. 1810110009 5 5 2592000 3600

;; Query time: 24 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Oct 12 21:18:49 HKT 2018
;; MSG SIZE rcvd: 126

smartdns如果统一IPV6返回SOA的话,终端设备应该会使用A地址才对。

你用什么测试的,windows浏览器?

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

我刚刚测试结果是,dig谷歌的AAAA时,force-AAAA-SOA yes后,延迟1千多才返回SOA,而force-AAAA-SOA no后,500左右就能返回AAAA了,所以虽然force-AAAA-SOA yes,但是smartdns还是会先查询AAAA、测试,最后再丢弃掉结果,只返回SOA吗?
因为dig AAAA时明显时间比正常情况下花的更多,不过dig A时延迟倒是比较正常
win 10,centbrowser最新版

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

确认了代码,是立即返回的

root@raspberrypi:/home/pi/code # dig -t AAAA www.google.com @127.0.0.1

; <<>> DiG 9.10.3-P4-Raspbian <<>> -t AAAA www.google.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2339
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com. IN AAAA

;; AUTHORITY SECTION:
www.google.com. 0 IN SOA a.gtld-servers.net. nstld.verisign-grs.com. 1800 1800 900 604800 86400

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 12 21:49:02 HKT 2018
;; MSG SIZE rcvd: 122

看这个,返回时间是0ms,

不过我改了一个返回码,我更新了一下,再试一下看看。

release 14

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

我是把smartdns作为dnsmasq的上游,刚刚试了下,yes后直接dig smartdns的AAAA后确实延迟很低,所以可能 是我刚刚没设置好。但是所有网站第一次访问都打不开,要等3-5秒以后才能正常打开,这在centbrowser和火狐都能复现,只不过centbrowser有如下提示,火狐只是说找不到服务器ip
dns_probe_finished_bad_config
DNS_PROBE_FINISHED_NXDOMAIN
这是不是因为ipv6优先导致的?

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

系统是先请求IPV6的。

你试一release 14重新发布的版本看看。

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

神奇,好了,不会再出现那个问题了。

from smartdns.

kkkgo avatar kkkgo commented on July 3, 2024

也有同样问题,一方面是国内的网站ipv6没cdn,另一方面是有的国外网站IPV6连不上。建议增加这三种选项:
1、【速度优先】同时检测该域名AAAA和A记录的延迟,仅在AAAA延迟比A记录低时返回AAAA记录,否则只返回A记录,强行过滤AAAA;
2、【IPV4优先】当该域名同时存在AAAA和A记录时,仅返回A记录;当该域名仅存在AAAA记录时,返回AAAA记录;
3、【指定list】指定某些域名仅使用IPV6/IPV4结果(比如一些ipv6的下载站)

from smartdns.

HSXX avatar HSXX commented on July 3, 2024

有没有选项不优选IP呢?直接返回原始结果的IPV4,过滤IPV6

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

@HSXX @523860169 @lixuy
Release18 增加了双栈IP优选的功能,可以试用,如有问题,请提交issue

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

@pymumu
ipset规则好像不能用,我是直接另建ss.conf,在custom.conf里指定加载,结果并没有生效。
address规则不能放在address.conf,不然smartdns不能正常工作(无法返回所有dns结果),而另建ad.conf文件后,address规则正常,smartdns也工作正常

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

配置发一下看看,我验证是好的。

例子:
address /qq.com/127.0.0.1
ipset /www.baidu.com/block

加载配置

conf-file /path/file

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

@pymumu ss.conf

# Add custom settings here.

server-name smartdns

# dns server bind ip and port, default dns server port is 53.
# bind [IP]:port, 
# example: 
#   IPV4: :53
#   IPV6  [::]:53

bind :5353
cache-size 0
#force-AAAA-SOA no
# 启用IPv4/IPv6双栈优选
#dualstack-ip-selection-threshold 100
#dualstack-ip-selection yes

rr-ttl-min 60
#rr-ttl-max 86400

# set log level
# log-level [level], level=error, warn, info, debug
log-level error

# log-size k,m,g
log-size 128k

log-file /var/log/smartdns.log
log-num 2

# remote udp dns server list
# server [IP]:[PORT], default port is 53
server 58.22.96.66
server 218.104.128.106
server 114.114.114.114
server 114.114.115.115
server 223.5.5.5
server 223.6.6.6
server 1.2.4.8
server 210.2.4.8
server 119.29.29.29
server 117.50.11.11
server 117.50.22.22
server 8.8.8.8
#中科大
server 202.141.162.123:5353
#OpenDNS
server 208.67.220.220:443
server 208.67.222.222:443
#rubyfish.cn
server-tls 115.159.154.226:853
server-tls 47.99.165.31:853
server-tls 8.8.8.8:853
server-tls 1.1.1.1:853

# List of hosts that supply bogus NX domain results 
# bogus-nxdomain [ip]
bogus-nxdomain 220.250.64.0/24

conf-file /etc/dnsmasq.d/ss.conf

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

这个配置文件我用了没有问题。

是不是你最后那个ss.conf文件格式不正确。

smartdns配置项格式和dnsmasq是不同的。

另外还有一个事情,ECS现在功能还没实现,只有配置项。

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

@pymumu 不行哦,我只添加了一条规则到custom.conf里,也还是没有生效
ipset=/ip.ming92.tk/proxylist

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

ipset后面是空格,不是等号。

ipset /ip.ming92.tk/proxylist

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

是,我也发现了。。。。没注意,直接把dnsmasq用的规则加载过去了
sorry

from smartdns.

o0HalfLife0o avatar o0HalfLife0o commented on July 3, 2024

@pymumu 对了,google的部分域名返回的是北京的ip,但是只用ipset的话,也会把这部分不用走代理的也走代理,我一直在找iptables规则,但是试了很多次,都是一会儿可以一会儿不行,请问你有什么办法或规则分享的吗

from smartdns.

pymumu avatar pymumu commented on July 3, 2024

你说的是子域名把。

后面会支持指定子域名排除规则。
现在的话,只能增加一个不走代理的ipset,把子域名加入那个ipset中。

from smartdns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.