To give false DNS responses from userland we need to handle different type of syscalls : gethostbyname()
, gethostbyname2()
, getaddrinfo()
, getnameinfo()
, etc.
To cover all these cases, and to prevent leaks to real dns servers, we will use two libraries : libresolv_wrapper and libnss_wrapper.
Install resolv_wrapper and nss_wrapper, either from sources or from your favorite Linux distribution.