MacOS – How to access DNS server on non-standard port on macOS

dnsmacos

I need to use a DNS server that serves on port 5353, how do I specify the port in the system DNS settings?

Best Answer

[Edited]

You cannot. Most all DNS clients expect that the DNS server will be listening on port 53. All DNS servers run on port 53, period, end of discussion. Yet you can run them on alternate ports but the only operating system that allows a DNS client to connect directly to a custom DNS server on a non-standard port is OpenBSD. That means every other OS will have difficulty connecting directly to your DNS server running on port 5353 and will fail.

You may be doing something unusual such as dnsmasq or unbound, etc. Or you are on a network that restricts port 53 which breaks Internet standards. You must then setup a router or perhaps a proxy redirect to be the IP address that receives the DNS client connections on port 53 and forwards / redirects to the actual DNS server running on port 5353. You may be able to get around restrictions via VPN or SSH port forwarding.

Would need much more detail to answer the question any further.