How to find out why a local redirect is happening?
One common way on macOS to override the regular DNS for one (or a few) top-level domain(s) is to create a file in /etc/resolver/ (e.g. /etc/resolver/dev), and list an alternate server there. See this Mac OS X Hints item and this answer about using dnsmasq with .dev domains. If that's where the override is, just remove the file (you can leave the directory or remove it if you prefer).