The issue I am facing:
I'm using Pi-hole mainly for the ad-blocking.
I'd like to add a separate host-file that gets total priority over everything. So if the entry is in this specific hostfile, Pi-hole answers with this, and ignore all further checks.
I'll generate the file from a php script so if it needs to be in a specific format (ie. non standard hosts format) I can work that out.
TTL should be small as the file will be updated every hour.
Details about my system:
Fresh PiHole setup on simple Ubuntu VM, dedicated to Pi-hole.
I ended up with adding /etc/dnsmasq.d/30-x.conf
After I generate the file I do service pihole-FTL restart
Seems to work as desired.
A follow up question....
if I define the same host in /etc/dnsmasq.d/30-x.conf and /etc/dnsmasq.d/40-x.conf with different IPs, which one will be used?
All of them. Hosts can have multiple IP addresses, e.g. for load balancing purposes. When multiple addresses are specified for a host, they will be rotated (round-robin).