5 ms·
Those redirections happen further in the stack. You are ok reading settings from /etc/resolve.conf, which frequently points to a localhost daemon that redirects
by habibur 3y ago
Those redirections happen further in the stack. You are ok reading settings from /etc/resolve.conf, which frequently points to a localhost daemon that redirects your calls to whatever DNS setting you have in your connection.
But parsing /etc/resolve.conf and using it is all that you need in your code.
- guappa 3y agoAnd your code correctly parses all the options that can be in that file?
- habibur 3y agoYou don't need all the options. Search google. Parsing resolve.conf is an old technique and the file was written assuming individual apps will be parsing it. You will find instructions on how to do it in say 4 lines. Explicitly for this file. Not any random conf file from the system.
- guappa 3y agoThen your application won't be portable. Which is fine if you have no plans of distributing it. But otherwise I can guarantee it will break on some machine.
- uxp8u61q 3y agoYour complete lack of mention of nsswitch.conf makes me believe that you're not implenting anything correctly in this instance.
- Karellen 3y ago* /etc/resolv.conf