I need to configure more than 3 DNS servers in "/etc/resolv.conf". According to man, it is not supported so I have to recompile glibc
Up to MAXNS (currently 3) name servers may be listed, one per line. If there are multiple servers,
the resolver library queries them in the order listed. If no nameserver entries are present, the default is to use the name server on the local machine. (The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all name servers until a maximum number of retries are performed.)
I changed the constant MAXNS
in resolv/bits/types/res_state.h
and I compiled as follows:
mkdir glibc-build
cd glibc-build
../glibc-(version of glibc)/configure --prefix=/usr/local/lib/glibc-testing --with-tls --enable-add-ons=nptl
make
make install
I tried to ping some sites and with the help of Wireshark I tried to see which servers it was addressing. The servers still addressed the first three addresses.
I also saw that the file /usr/include/x86_64-linux-gnu/bits/types/res_state.h
did not change.
What is the problem?