Here is VDS server with ip(for example 105.123.123.123) with working apache service. And there is a desktop computer with linux on board(but really I presume there is no difference). I need to type on web browser address like someaddress.com and to see website situated at 开发者_如何学Cmy server. My /etc/hosts:
127.0.0.1 localhost
105.123.123.123 someaddress.com
105.123.123.123 www.someaddress.com
But it doesn't work. I see real someaddress.com website. What can be wrong. It will be great if you help me with that.
P.S. Why I need this. There is one project with fixed links(like someaddress.com/inf). And I need to test it.
Maybe your distribution is preferring DNS over values in /etc/hosts. Check /etc/nsswitch.conf. It should have a hosts line something like:
hosts: files dns
Just make sure files comes before dns.
精彩评论