resolvconf_override provides a shared library
to be used as an
LD_PRELOAD to override the
nameservers listed in
/etc/resolv.conf on glibc-based
systems (eg. most Linux distributions).
$ mkdir build $ cd build $ meson .. $ ninja
To use the Google DNS in place of the ones mentioned in /etc/resolv.conf you would run:
LD_PRELOAD=/usr/lib64/libresolvconf-override.so NAMESERVER1=22.214.171.124 NAMESERVER2=126.96.36.199 myapplication
Invalid nameserver names passed as arguments are ignored.
If you want to force the use of TCP for DNS requests, set the
FORCE_DNS_OVER_TCP environment variable.
The shared library overrides the
res_init() system calls. It does not support IPv6, and might
be lacking particular system calls overrides for all applications
to work as expected.
This code is under the same license as the glibc itself (GNU Lesser General Public License v 2.1)
See the glibc license for details: http://www.gnu.org/software/libc/manual/html_mono/libc.html#Copying
Copyright Bastien Nocera <email@example.com> 2013,2017