3 ms·
Looking at the code in the DNS service in Firefox, it kinda looks like this for localhost: 1) If IPv6 disabled in prefs or caller explicitly requested IPv4 onl
by bzbarsky 6y ago
Looking at the code in the DNS service in Firefox, it kinda looks like this for localhost:
1) If IPv6 disabled in prefs or caller explicitly requested IPv4 only, 127.0.0.1.
2) If localhost explicitly listed in the IPv4-only domains list in prefs, 127.0.0.1.
3) If caller explicitly requested IPv6 only, ::1.
4) Otherwise both 127.0.0.1 and ::1.
See nsHostResolver::InitLoopbackRecord in https://searchfox.org/mozilla-central/source/netwerk/dns/nsHostResolver.cpp https://searchfox.org/mozilla-central/source/netwerk/dns/nsH... and nsDNSService::GetAFForLookup in https://searchfox.org/mozilla-central/source/netwerk/dns/nsDNSService2.cpp https://searchfox.org/mozilla-central/source/netwerk/dns/nsD... for the key.af calculation that goes into that, as far as I can tell.
- deleted 6y ago[deleted]