Why all *.dev domains target to my localhost?

半城伤御伤魂 提交于 2019-12-30 19:55:25

问题


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)


回答1:


Do a lookup for a TXT record at that name and things will become clearer :-)

.DEV is a recently registered top-level domain, and currently in an initial period where it's seeded with data meant to alert people using it privately that they're about to have a problem. Part of that is to return only the address 127.0.53.53, which is special enough to be obvious in log files and similar, but also in the 127.0.0.0/8 block that is defined as loopback for IPv4. Which is why you get your own machine. In a few months or so, you'll almost certainly start getting NXDOMAINs instead.




回答2:


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.



来源:https://stackoverflow.com/questions/28199785/why-all-dev-domains-target-to-my-localhost

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!