A fake DNS server only has handful of use cases, but in case you find yourself in need of them, here are some instructions!
The primary usage for something like this would be if you're interested in changing what IP a domain resolves to, such as redirecting an embedded's devices HTTP request to
phone-home.private-protocol.proprietary.net to your own machine rather than the actual page.
The first step is to install
dnsmasq with your package manager. This will usually be
brew install dnsmasq.
For every domain that you want to manually redirect, create a file in
/etc/dnsmasq.d/, for instance
In that file you can put a list of the domains, such as:
And those domains will be resolved to the respective IP by any devices that use your fake DNS server.
Any domains that are not added here, will be resolved using the DNS server on the same machine. Usually this is specified in
If you want to block all domains, you can use the following dnsmasq entry: