Question: If I cat my resolv.conf, I see this message:

```
#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#

```

I am trying to add a DNS entry. I edited my hosts file and flushed the dns cache, but the name is not resolving if I use `host servername`. I thought perhaps that `host` was not configured to look at the `hosts` file. How can I get my new entry to resolve, and what is OSX using if not `resolv.conf`?

Answer: 
DNS resolvers can be added in OS X via the `networksetup` command:

```
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4

```

Insert name of network connection as appropriate. These resolvers will appear in resolv.conf as it is automatically generated, but direct edits to resolv.conf will not result in those resolvers being used. I assume the resolvers are stored in a plist somewhere; I will search and report back.

Edited to add: It looks like the XML plist file storing the DNS servers is `/Library/Preferences/SystemConfiguration/preferences.plist`.

The host file in /private/etc/hosts should work to force resolution for particular names (/etc is a symlink to /private/etc). Can you verify your syntax and that you are editing the correct file?
To setup a custom DNS-resolver, for example running dnsmasq on your own machine, you'd create the following directory:

`/etc/resolver/` (with e.g. `sudo mkdir -p /etc/resolver`)

Then one file per domain you want to add custom lookup for.

The file `/etc/resolver/my-domain.dev` could look like this:

```
nameserver 127.0.0.1
port 5353

```

(omit port if you're using the standard port of `53`)

This would instruct macOS to always use the local resolver to resolve IPs under this domain. That resolver could run on your machine, or be a resolver in your data center (via Wireguard/VPN), for example.