macOS Get DNS Servers
$ scutil --dns | grep nameserver | sort -u
nameserver[0] : 1.1.1.1
nameserver[1] : 1.0.0.1
nameserver[2] : 2606:4700:4700::1111
nameserver[3] : 2606:4700:4700::1001
Read other posts
$ scutil --dns | grep nameserver | sort -u
nameserver[0] : 1.1.1.1
nameserver[1] : 1.0.0.1
nameserver[2] : 2606:4700:4700::1111
nameserver[3] : 2606:4700:4700::1001