3

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.

astrob0t
  • 1,746
Bernhard
  • 203
  • 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 05 '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 05 '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 05 '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 06 '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 07 '14 at 02:03

1 Answers1

-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.

astrob0t
  • 1,746
  • 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 05 '14 at 22:23
  • This answer is in left field. See the link I gave above. – Panther Nov 06 '14 at 00:17