3

This question already has an answer here:

I have added a line like the following to my /etc/hosts file:

159.253.x.xxx www.***.nl

When I ping to www.***.nl it gives me the correct ip address back but when I use my browser I do not get to 159.253.x.xxx (which is my development server containing a copy of the actual site).

My question is, how do I solve this?

I'm running Ubuntu 14.04.

marked as duplicate by Panther, Charles Green, αғsнιη, Eric Carvalho, Avinash Raj Nov 22 '14 at 9:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • when you say development server, do you mean it is a server that you have hosted on your own or have you rented it from a hosting company? – astrob0t Nov 5 '14 at 21:23
  • When you say "doesn't work" please explain what you mean exactly. What doesn't work? What are you getting instead of what you expect? To me, it sounds like you have a problem with the configuration of the web server. – dobey Nov 5 '14 at 21:24
  • The development server and the live server are both two VPS servers I rent from a hosting company. I do not have a maintanance contract with them so I have to do all the work myself. On the development server the vhost configuration is correct. On the live server the website is running as expected. What happens is that I end up on the website running on the live server instead of the development server. – Bernhard Nov 5 '14 at 22:19
  • @bodhi.zazen As you can see in the answers and comments of that topic, the options listed there only work till Ubuntu 13.10. I run 14.04 – Bernhard Nov 6 '14 at 23:45
  • Should work for 14.04, did you try it ? If so, post your config files so we can check them for syntax. – Panther Nov 7 '14 at 2:03
-2

Until and unless a website is hosted on a dedicated IP, you will never be able to reach the website/domain by typing in the IP in the address bar even though you will be able to ping the ip address. This is the reason, Hosting companies are able to host thousands/millions of domains on a single IP via shared hosting plans and as a result the hosting charges are less.

  • I know this. I have been building websites for 10 years now. It is clear to me how DNS works ;-) I don't type the ip address in the address bar but the domain name I have set up in the hostsfile. The development server and the live server are both two VPS servers I rent from a hosting company. I do not have a maintanance contract with them so I have to do all the work myself. On the development server the vhost configuration is correct. – Bernhard Nov 5 '14 at 22:23
  • This answer is in left field. See the link I gave above. – Panther Nov 6 '14 at 0:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.