[Mildly OT] Userland Control Of getbostbyname()

Tim Daneliuk tundra at tundraware.com
Fri Sep 30 13:48:32 UTC 2016

Is it possible to control *which* DNS server (and port) a userland program
queries for DNS resolution when doing gethosbyname() and gethostbyip()
calls?  dig and nslookup seem capable of defining the DNS server to query,
but I don't know if they're doing the call directly or via the gethostby...

In a perfect world, I'd get a solution to this that was language agnostic -
a way to tell my userland programs - in C, Java, Python, perl, go ... 
always use this server:port when doing name resolution.

Tim Daneliuk     tundra at tundraware.com
PGP Key:         http://www.tundraware.com/PGP/

More information about the freebsd-questions mailing list