3 ms·
In Go's case, because DNS is such a bear. Not the looking up part, but all the sources and behaviors behind where and how to lookup. IIRC they couldn't even d
by silisili 4y ago
In Go's case, because DNS is such a bear. Not the looking up part, but all the sources and behaviors behind where and how to lookup.
IIRC they couldn't even do it natively on MacOS due to system restrictions, unsure if that's still the case.
- cpach 4y agoNative DNS lookups is possible in Go on macOS. But it seems the road to get there was not exactly smooth.
- mseepgood 4y agoIt's not difficult, and it was done like that for some time, but the macOS system call interface is not guaranteed to be stable (more like guaranteed to be unstable), so the correct thing on macOS is to go through libc (libSystem), which Go now does since 1.12.
- cpach 4y agoNot exactly rocket science perhaps, but AFAICT there was some long-running tickets related to DNS lookups on macOS.
- jen20 4y agoFor DNS specifically, this landed in Go 1.20: here is the change set [1]. A different change [2] had a similar effect of using the system facilities for certificate validation in 1.18. In general, using the custom stuff “works” (until it doesn’t!) but results in janky programs that don’t behave with respect to split tunnel DNS and so forth - very common with cross compiled programs until recently. [1]: https://go-review.googlesource.com/c/go/+/446178 https://go-review.googlesource.com/c/go/+/446178 [2]: https://go-review.googlesource.com/c/go/+/353132 https://go-review.googlesource.com/c/go/+/353132
- cpuguy83 4y agoIs dns lookup provided by the kernel on macOS? I'm pretty sure this would all be done in userspace anyway. There is no "native" way to do this unless you consider libc (or libsystem) "native". There is no kernel interface to do dnd lookups just standard userspace tooling.