I have a domain that points to the external IP of my webserver. I set up a Pi-Hole server and changed my network settings to use it, and I've verified it is working. I want to redirect the URL of my webserver, which points to the external IP, to the internal IP of the webserver.
I used the command
sudo pihole -a hostrecord example.com 192.168.0.12
to redirect the domain to the IP. But when I try to connect to it through ping, nslookup, and using a browser it goes to the external IP.
I then did the command again, but this time with the domain misspelled.
sudo pihole -a hostrecord eexample.com 192.168.0.12
This time it worked and visiting eexample.com worked as expected and it was redirected to the correct IP.
I've cleared my computer's DNS cache and Pi-Hole's. Also, when I visited the correct domain on my phone (connected to the network and had mobile data turned off), which had never connected to the site before, it worked as expected.
What's going on?