Skip to main content
2 of 2
added 143 characters in body
kenorb
  • 13k
  • 18
  • 88
  • 154

The following shell command can be useful to list the current DNS entries:

grep nameserver <(scutil --dns) 

To filter it out for the script, you can pipe the output into awk '{print $3}' or grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" command.

kenorb
  • 13k
  • 18
  • 88
  • 154