According to https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/resolver.5.html

you should be able to set a different port for dns, ie:

 example, specifies that the nameserver at uses port 55.


sh-3.2# networksetup -setdnsservers Ethernet is not a valid IP address. No changes were saved...
** Error: The parameters were not valid.

what gives? how can I fix this?

  • Hi, may i ask why you want to set a different port for DNS? (some more context might lead to other solutions...)
    – Motsel
    Jun 4, 2015 at 21:19
  • hi, my ISP is hijacking traffic on port 53, it has a transparent proxy, so I discovered that I can use any DNS and always get the same results from my isp, Vodafone shame on you
    – sathia
    Jun 5, 2015 at 6:52
  • The issue is that you are using . to true to delimit the paddles and the port - usual this should be : (although your answer says #)
    – mmmmmm
    Jun 5, 2015 at 16:15
  • tried that as well if I recall correctly. dnsmasq is another program with its own syntax
    – sathia
    Jun 5, 2015 at 17:13

1 Answer 1


So, the reason for this was that my ISP is filtering DNS requests on port 53. What I did in order to circumvent this hideous action by Vodafone was to install dnsmasq on my mac and add this line to the dnsmasq.conf file:


as you can see I'm now happily using open dns' DNS on port 5353

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .