dnsConfig for alternate resolv.conf

100 views
Skip to first unread message

Denton Gentry

unread,
Jun 19, 2025, 1:46:32 PMJun 19
to golang-nuts
One can supply a net.Resolver with a Dial function to connect to whatever DNS server one wishes.

I have a system where an alternate set of DNS servers is written to /usr/local/etc/resolv.conf. I don't see a straightforward way to supply my own dnsConfig which reads in this alternate resolv.conf to replace the configuration read from /etc/resolv.conf.

If there were a way to do this I could leave the regular Dial implementation and other functionality in place, could let it choose amongst the set of available DNS servers, etc.

Searching github hasn't turned up examples of implementing reading in an alternate dnsConfig, is there nonetheless a way to do so?

Sean Liao

unread,
Jun 19, 2025, 1:52:32 PMJun 19
to golang-nuts
No, the only exposed API is Dial.

- sean

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/37516741-6a10-432c-8ccf-046f7760b73fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages