4

In resolver manual, it said:

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

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

208.67.222.222.5353

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

Update:

osx don't use /etc/resolve.conf, but use files under /etc/resolver/. I have wrote a file dev with content '127.0.0.1' 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?

Cofyc
  • 41
  • 1
  • 4
  • Sounds like OSX doesn't user /etc/resolve.conf, start looking elsewhere. – SpacemanSpiff Jul 01 '13 at 02: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. – Allison Nov 01 '17 at 02:31
  • 1
    This is not a duplicate. Please re-open. The linked to answer has nothing to do with specifying a port other than 53 for a nameserver which is clearly documented in the man page https://www.unix.com/man-page/opendarwin/5/resolver/ which the user clearly provided. – Josh Woodcock Oct 01 '19 at 11:05

1 Answers1

0

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:

tylerl
  • 15,055
  • 7
  • 51
  • 72