This question already has an answer here:

In resolver manual, it said:

The address may optionally have a trailing dot followed by a port number.
For example, specifies that
the nameserver at
uses port 55.

But it doesn't work, in /etc/resolv.conf or files under /etc/resolver/.

Can I specify non-default port number for nameserver in osx?


osx don't use /etc/resolve.conf, but use files under /etc/resolver/. I have wrote a file dev with content '' to route all dns queries for *.dev domains to a local dns server (127.0.0.). But I cannot specify dns server's port here. (It uses 53 anyway)

Maybe there is no way to specify port number under osx?

marked as duplicate by Chris S Jul 1 '13 at 4:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Sounds like OSX doesn't user /etc/resolve.conf, start looking elsewhere. – SpacemanSpiff Jul 1 '13 at 2:38
  • I don't think this is a duplicate because the "duplicate" question doesn't answer this one. This is specifically about setting the DNS port and not just the IP. – Sirens Nov 1 '17 at 2:31

OSX doesn't use /etc/resolv.conf -- the information in that file is generated for your information only: it's meant to be read, not written.

See this answer here for how to modify your resolver configuration under OSX:

Not the answer you're looking for? Browse other questions tagged or ask your own question.