If you run in to trouble with macOS and DNS here is a little line that will help you clear the DNS cache right up:

sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder