Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why all *.dev domains target to my localhost?

Tags:

dns

When you type *.dev domains, for example juas.dev it points to localhost, someone know why ?

(My hosts are not modified, and the request dont go outside)

like image 889
eveevans Avatar asked Jan 28 '15 18:01

eveevans


1 Answers

I have just suffered this exact issue and it was driving me crazy. I couldn't access any .dev domains on the web. Trying to load a .dev website was causing a security warning in Chrome because it was using a default self-signed certificate somewhere on my machine, resolving all .dev domains to 127.0.0.1.

If your operating system is Mac OS X, this might solve it, as it worked for me.

In Terminal, type this command:

cd /etc/resolver/ && ls

If you see an entry name dev when you hit the Enter key, then chances are this is a wildcard resolver pointing all your attempts to access .dev domains to 127.0.0.1, ie. localhost.

Simply renaming this gets rid of it. You need admin permissions so (assuming you are still in /etc/resolver/) run this command:

sudo mv dev dev.ignore

You should instantly be able to access .dev domains on the web.

If moving it doesn't work, you can try deleting it with sudo rm dev as a last resort.

like image 106
codewithfeeling Avatar answered Oct 03 '22 23:10

codewithfeeling