It’s Not Always DNS: Exploring How Name Resolution Works
Posted by Helpful_Geologist430@reddit | programming | View on Reddit | 10 comments
Posted by Helpful_Geologist430@reddit | programming | View on Reddit | 10 comments
Penta_FTW@reddit
Not all languages use getaddrinfo. Go uses its own DNS implementation. In python, there's dnspython. But getaddrinfo is still probably the norm
Helpful_Geologist430@reddit (OP)
I wonder why. To avoid the dependency on std lib ?
nekokattt@reddit
which standard library?
In this case it is an OS-specific call.
Helpful_Geologist430@reddit (OP)
I was referring to the C std lib. Either glibc or musl. Because that's where getaddrinfo is implemented
nekokattt@reddit
Yeah so in that case, it is to not have to depend on libc.
tetrahedral@reddit
I’m gonna hazard a guess it’s related to not blocking threads/goroutines.
Helpful_Geologist430@reddit (OP)
Right on the money
https://pkg.go.dev/net#hdr-Name_Resolution
Interestingly, the native resolver (cgo) is always used in OSX or if there are options unsupported by the the pure go implem in nsswitch.conf in Unix. Gotta love sane behavior!
s-mores@reddit
It's not DNS
There's no way it's DNS
It was DNS
Helpful_Geologist430@reddit (OP)
In this particular case it wasn't! People lost millions in the betting markets
RelevantEmergency707@reddit
Still not convinced it was not DNS 😂 Maybe Cloud flare made up the huge config file story to just avoid the DNS embarrassment