storkinsj
Occasional Visitor
Hi All,
This is a bit of a weird configuration and I am not sure if it can be done.
Goal:
-Part A: If a DNS request for a host matches a list of host names, pass request to upstream DNS server
-Part B: If it doesn't match one of those host names, I want to send it to a sink-hole
Part B is doable with the --address directive.
Part A I can't figure out. If a request gets to dnsmasq it will check its host table and if it's not in there, it will forward to upstream or use the --address default IP. The challenge is I know the hostnames, but need the upstream server to discover the IP address.
The only thing I can guess I can do is prefetch the IP addresses from the hosts in the whitelist from the upstream server and then push those into dnsmasq at runtime. The challenge is, in my environment those ip addresses can change. So ideally I would ALWAYS ask the upstream server for information related to those hosts.
I realize this is not a normal configuration so I appreciate the help. Please let me know if there is a better section of snbforums for this sort of question.
In effect, If I could be "called back" (hooked) for each dns request and let the daemon know if the request should be serviced or not.
Thanks!
This is a bit of a weird configuration and I am not sure if it can be done.
Goal:
-Part A: If a DNS request for a host matches a list of host names, pass request to upstream DNS server
-Part B: If it doesn't match one of those host names, I want to send it to a sink-hole
Part B is doable with the --address directive.
Part A I can't figure out. If a request gets to dnsmasq it will check its host table and if it's not in there, it will forward to upstream or use the --address default IP. The challenge is I know the hostnames, but need the upstream server to discover the IP address.
The only thing I can guess I can do is prefetch the IP addresses from the hosts in the whitelist from the upstream server and then push those into dnsmasq at runtime. The challenge is, in my environment those ip addresses can change. So ideally I would ALWAYS ask the upstream server for information related to those hosts.
I realize this is not a normal configuration so I appreciate the help. Please let me know if there is a better section of snbforums for this sort of question.
In effect, If I could be "called back" (hooked) for each dns request and let the daemon know if the request should be serviced or not.
Thanks!