I want to create a host file on a custom location (ex. /opt/app/hosts) with the same formatting as the /etc/hosts file.
The reason for this is that I want to manually query a DNS server for a specific range of hosts and write those to my own custom host file. I can't add that DNS server to the /etc/resolv.conf because I don't want the server to try resolving hosts with it (apart from the small subset that I query manually).
I've tried searching for a way to include it in /etc/hosts or configure it in /etc/nsswitch.conf or /etc/resolv.conf but as far as I can tell neither of these configuration files contain.