Re:Go 1.16 will make system calls through Libc on OpenBSD
by alaties on Tuesday February 02, 2021 @01:10AM
(#25997892)
Had a similar problem a couple years ago where I needed to use alternative DNS libraries to troubleshoot issues in a company's infrastructure.
Golang's rules for what implementation to use are found here: https://golang.org/pkg/net/#hdr-Name_Resolution
A really solid alternative DNS client implementation can be found here: https://github.com/miekg/dns. Real easy to read and vet compared to a few other libraries I ran into when working on this problem.
Re:Go 1.16 will make system calls through Libc on OpenBSD
by JoshTriplett on Tuesday February 02, 2021 @12:48AM
(#25997798)
I'm currently in the process, right now, of writing a minimal init in Rust to do exactly the same thing. Is yours something you'd consider sharing?
The sum total of what I want to do: bring up loopback, bring up the one and only Ethernet interface, set up its IP and basic routing, run another program, and do some basic log reporting.
Re:Go 1.16 will make system calls through Libc on OpenBSD
by tptacek on Tuesday February 02, 2021 @12:50AM
(#25997804)
I hack on our init, but I didn't write it. So it's not my place to share it. And there's some us-specific stuff in it that wouldn't be super helpful to you. But you could definitely ask Jerome on our team; he's a super helpful guy, even if he's super quiet here (he's like the anti-me). One way or the other I'm sure we can help you get where you're going!
Re:Go 1.16 will make system calls through Libc on OpenBSD
by JoshTriplett on Tuesday February 02, 2021 @01:04AM
(#25997856)
I reached out to Jerome. Thanks!
Re:Go 1.16 will make system calls through Libc on OpenBSD
by tptacek on Tuesday February 02, 2021 @01:11AM
(#25997893)
Feel free to follow up with Kurt, me or Michael if you don't get a quick response; Jerome is in Montreal and he may be buried under a mountain of snow and brown gravy.
Re:Go 1.16 will make system calls through Libc on OpenBSD
by vidarh on Tuesday February 02, 2021 @03:41AM
(#25998612)
If you can can control which DNS servers it talks to, implementing the DNS spec directly is a pretty trivial exercise to get full control. (If you can't, the main complexity is dealing with implementation quirks)
I wouldn't want to take the thread off on a huge tangent, it's just funny that this was just recently super relevant to me (it would have been problematic if DNS-dependent Go programs depended on libc, because right now I can't assume there's a libc binary to be dynamically linked to).
Bringing it back to Go and its (sometimes libc-dependent) DNS libraries: it is very annoying how fiddly it is to get a Go program to use an alternative DNS server.