speedtest-go
speedtest-go copied to clipboard
DNS request supports binding source
Hello, I saw this parameter: "--source=SOURCE", but through packet capture, I found that the dns request did not take effect.
speedtest-go --source=192.18.0.1
speedtest-go v1.6.10 @showwin
✓ ISP: *** (Unknown) [1.3673, 103.8014]
✓ Found 46 Public Servers
...
tcpdump: listening on any, link-type LINUX_SLL (Linux cooked v1), capture size 262144 bytes
14:30:42.167460 IP (tos 0x0, ttl 64, id 59960, offset 0, flags [DF], proto UDP (17), length 74)
100.100.103.1.52267 > 8.8.8.8.53: 9131+ [1au] A? www.speedtest.net. (46)
14:30:42.167680 IP (tos 0x0, ttl 64, id 59961, offset 0, flags [DF], proto UDP (17), length 74)
100.100.103.1.56382 > 8.8.8.8.53: 1172+ [1au] AAAA? www.speedtest.net. (46)
14:30:42.174993 IP (tos 0x0, ttl 57, id 55112, offset 0, flags [DF], proto UDP (17), length 179)
8.8.8.8.53 > 100.100.103.1.56382: 1172 1/1/1 www.speedtest.net. CNAME www.speedtest.net.cdn.cloudflare.net. (151)
14:30:42.174993 IP (tos 0x0, ttl 57, id 55113, offset 0, flags [DF], proto UDP (17), length 153)
8.8.8.8.53 > 100.100.103.1.52267: 9131 3/0/1 www.speedtest.net. CNAME www.speedtest.net.cdn.cloudflare.net., www.speedtest.net.cdn.cloudflare.net. A 104.18.202.232, www.speedtest.net.cdn.cloudflare.net. A 104.18.203.232 (125)
Hi, @pig98, could we merge --dns-bind-source to --source? or bind dns source by default.
By default, the dns lookup should be consistent with the requested interface to prevent the possibility of being unable to connect.
Hi, @pig98, could we merge --dns-bind-source to --source? or bind dns source by default.
By default, the dns lookup should be consistent with the requested interface to prevent the possibility of being unable to connect.
Thank you for your reply! Binding the DNS source address by default is a good idea.
However, I've noticed that some other open-source speed test tools, like sivel/speedtest-cli, also don't use --source to bind DNS.
I'm unsure if binding DNS in some scenarios might trigger other unexpected issues. If we can ensure that binding DNS won't have any negative impacts or will have minimal impact, making it the default behavior would be ideal.
Otherwise, I think it's best to keep it as an experimental feature that's off by default.
Thank you!