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: 
The host tool does not simply *resolve names* (as in, using the system name resolver) but actually *queries dns servers* (as in, sending packets to udp/53 and possibly tcp/53): it doesn't know nor use the local `hosts` file.

If you want to test the operating system's resolver (as in, gethostbyname() and similar libc functions) you can try to ping the name you added to `/etc/hosts` and it will honor what you put in that file.

Also, as you already found out DNS lookup on Mac OSX does not use `/etc/resolv.conf`, and the correct way to configure which DNS servers are queried is in the Network Settings gui and/or `networksetup` commandline tool. I honestly don't know if you can configure the order in which sources are tried, but the standard behavior is to try `/etc/hosts` first and dns servers after that.
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.