1

What are the ways to persist DNS and SearchDomain settings? How to remove?

If I run scutil --dns it shows these two resolvers (and a few others for *.in-addr.arpa addresses)

resolver #1
  search domain[0] : 0.mydomain.com
  nameserver[0] : 10.10.50.53
  if_index : 15 (en0)
  flags    : Request A records
  reach    : 0x00000002 (Reachable)

resolver #2
  domain   : 0.mydomain.com
  nameserver[0] : 10.10.10.53
  flags    : Supplemental, Request A records
  reach    : 0x00020002 (Reachable,Directly Reachable Address)
  order    : 101600
...

Both resolvers include one of my domains, and #2 has the wrong nameserver IP.

I don't have a search domain configured on *Settings -> Network -> Detail -> DNS, and my local DHCP server does not provide a searchdomain.

If I remove the invalid resolver with:

# sudo scutil
# get State:/Network/Service/[redacted, random numbers and letters]/DNS
# d.show
<dictionary> {
  ServerAddresses : <array> {
    0 : 10.10.10.53
  }
  SupplementalMatchDomains : <array> {
    0 : 0.mydomain.com
  }
}
remove State:/Network/Service/a09acf02331d4926/DNS
quit

Then, scutil --dns shows the correct resolvers, without search domains.

resolver #1
  nameserver[0] : 10.10.50.53
  if_index : 15 (en0)
  flags    : Request A records
  reach    : 0x00000002 (Reachable)

resolver #2
  domain   : local
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 300000
...

After removing that key, everything works as expected. But that entry returns on every reboot.

What could be including this config? Where should I look at?

Edit: As suggested by @Allan, this ensures I`m not receiving the search domain setting from DHCP.

# ipconfig getpacket en0 | grep -i domain
domain_name_server (ip_mult): {10.10.50.53}
1
  • Try the command ipconfig getpacket enX | grep -i domain where X is the integer of your active network connection. Post the output with an edit to the question. This will tell you what is being set by DHCP.
    – Allan
    Commented Feb 14, 2023 at 23:06

1 Answer 1

1

Searching on my computer with sudo mdfind "0.[my-domain]" for the domain name guided me to /Library/Application Support/ZeroTier/One/networks.d, which has two files, [redacted-letters_and_numbers].local.conf and [redacted-letters_and_numbers].conf

The first file had Zeroties`s configuration to customize the DNS and searchdomain. I figured the "redacted" part were my zerotier network id.

I thought I had already uninstalled this VPN software, but ps aux | grep zerotier shows it is running. Removing it with sudo "/Library/Application Support/ZeroTier/One/uninstall.sh" solved my problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .