dns configuration

Hi,


how does dns configuration work on OS X (Mountain Lion, if that matters?)


I only found out how it does _not_ work. Any search yields only bogus or irrelevant information and unanswered questions.


In /etc/resolv.conf it states that this is not used for most things.


networksetup -getdnsservers shows that there are no dns servers configured for any "networkservice", even while dns is working perfectly (except for the case that needs a workaround).


So how does it actually work?


My preferred solution would be to forward it to a local dnsmasq server that can be configured with the necessary workaround, like good Linux distributions can do (at least a few years ago).

MacBook Pro with Retina display, OS X Mountain Lion (10.8.3)

Posted on Jan 4, 2016 2:06 AM

Reply
4 replies

Jan 5, 2016 12:38 AM in response to xochipisi

In most recent OS X releases (but not all, and since reverted), DNS translations occur and are cached via the mDNSResolver service.


Among other means, the current DNS resolvers are listed via the command scutil --dns

What problem or issue or error are you troubleshooting here; what is your particular question?

If you want to run your own local DNS server, then OS X Server (Server.app) is the usual approach, or — for a local network — setting up a dedicated plug computer or Geode or ARM box or some spare x86 box, with a DNS server running. Which could be OS X Server with a spare Mac around, too. Running OS X Server here would not be typical on a laptop, as servers are fond of fixed addresses, and most laptops wander networks.

There are postings around the 'net on using DNSmasq with OS X, via Homebrew or otherwise. I've not tried that.

Jan 4, 2016 7:51 AM in response to xochipisi

In /etc/resolv.conf it states that this is not used for most things.

resolve.conf is just a reflection of what is set in System Preferences -> Network -> Advanced -> DNS


If you wish to set your own DNS server then set it there using the [+] button.


Unless you have specific DNS needs, then give one of these DNS servers a try:

OpenDNS.org

208.67.222.222

208.67.220.220


Google DNS

8.8.8.8

8.8.4.4


If you are inside a corporate firewall and need to find company systems, then you need to find the DNS server your company wants you to use.

Jan 5, 2016 12:51 AM in response to MrHoffman

Thanks, I will start from man scutil to find more information.


Some providers sometimes have stale dynamic dns data. In dnsmasq, I would use server=/my-favourite-dyndns.example.com/dns.my-favourite-dyndns.example.com (replace the last part with a fixed ip address). Even Google DNS sometimes reverts to this stale data, and dns.my-favourite-dyndns.example.com is really not for any other queries. And actually I want to use the provider's server for everything that works.


And as a related problem, often nslookup finds the correct adresses while ping does not, or ping does and applications do not.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

dns configuration

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.