by styanax · 1y ago · 0 comments
While testing, I was using Google and Cloudflare as well, and started noticing something - Quad9 does not return all A records listed for a domain, the same way Google/Cloudflare do.
dig -t A google.com @8.8.8.8 +short (6x IPs)
dig -t A google.com @1.1.1.1 +short (6x IPs)
dig -t A google.com @9.9.9.9 +short (1x IP)
This gave me a weird feeling; I get there's a lot of DNS geo magic and 8.8/1.1 serve 2 different subnets, and 9.9 a third. But... where did the other 5 expected IPs from Quad9 get off to?https://mullvad.net/en/help/dns-over-https-and-dns-over-tls
TL;DR
dns.mullvad.net - 194.242.2.2 (no blocking)
adblock.dns.mullvad.net - 194.242.2.3 (ad and tracker blocking)
base.dns.mullvad.net - 194.242.2.4 (ad, tracker, malware blocking)
And others but I primarily use the last two. They offer it as a public service, similar to quad9.
# Mullvad Unfiltered
forward-addr: 2a07:e340::2@853#dns.mullvad.net
forward-addr: 194.242.2.2@853#dns.mullvad.net
# Mullvad Adblock
# forward-addr: 2a07:e340::3@853#adblock.dns.mullvad.net
# forward-addr: 194.242.2.3@853#adblock.dns.mullvad.net
As mentioned in the default unbound config, the "#" is not a comment when used in the value, it's used for TLS checks. I followed this simple blog post from years ago: https://www.jwillikers.com/dns-over-tls-with-unboundWhile I'm here: Google uses edns0 client subnet to geo target your client IP.
Try a dig -t txt o-o.myaddr.l.google.com @8.8.8.8 vs the others to see the src IP of the packet sent to Google's DNS server, and any edns0 info that came along with it.
As 9.9 returned an IPv6, I tested with AAAA records just now - 1.1/8.8 respond with 4x IPs, 9.9 only 1x so it mirrors the A records in spirit.
Using google is bad way to test this scenario, since they use EDNS and many other DNS load balancing methods to distribute the load.
$ dig -t A google.com @8.8.8.8 +short
142.250.184.206
$ dig -t A google.com @1.1.1.1 +short
216.58.206.46
$ dig -t A google.com @9.9.9.9 +short
142.250.185.238
Edit: in case useful to someone reading, right now I have an IP assigned out of this block:
NetRange: 172.32.0.0 - 172.63.255.255
CIDR: 172.32.0.0/11
NetName: TMO9
NetHandle: NET-172-32-0-0-1
Edit edit: in the network record is a link to the self-reported geo data, I missed that. Comment: Geofeed https://raw.githubusercontent.com/tmobile/tmus-geofeed/main/tmus-geo-ip.txtEach service port (IP:Port) can only receive 64k connections from each NAT IP, returning more IPs from DNS makes more connections available. Google is a very popular service, so it makes sense to do. (Less so for v6, though)
Alternately, if they can't get a good feel for where you are, returning A records for multiple locations makes sense, too.
No idea why 4 AAAA vs 6 A; Google runs dual stacked and I'd expect the same number of records for both; IIRC, 8 AAAA will usually fit in a 512 byte udp reply, and anyway DNS64 might expand As into AAAAs, so you have to gauge sizes with those anyway.
Interestingly, for Tor, the lowest common denominator local port exhaustion threshold at exit is 16384.
https://spec.torproject.org/proposals/348-udp-app-support.ht...