How do I browse to virtual websites running on the same network ?

I am trying to find out if it is possible to to use my browser to directly access virtual websites which are running on my network. I have a business grade broadband service delivered by ADSL, and my ISP has allocated me a fixed IP address. I have a couple of web sites running on Ubuntu Server 14.04 with Apache 2.4.7, although I don’t think the OS or webserver version is relevant to this problem. The “A” records have been set up correctly and at the moment the web sites work fine when viewed from the “outside world”, but I am unable to view them from a browser on a machine on the same network. The “solution” I use at the moment is to set up my mobile phone as a wireless hotsopt, and then connect my laptop to it. I can then use the laptop browser to view the sites by sending http requests via the 3g phone network to the WAN side of my router. Is there some way that I can get my browser (any browser) to send some kind of request to the server which will fool it in to serving up the pages from these virtual sites ? At the moment, if I try to browse to one of these sites, the external DNS appears to return the correct external IP address and I am then presented with the admin page for the router. Everything else that I try simply returns the default server page from /var/www/html

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
April 4, 2016
Accepted Answer

Without going intro the intricacies of your network configuration the first thing I would recommend is that you set up a host file entry on the machine you want to use to browse the site from within the network.

On windows, the hosts file is located in C:\Windows\system32\drivers\etc\hosts On Linux and OSX it can be found in /etc/hosts

If you add an entry there (on the computer you are browsing from) that maps the domain name to the LAN IP address (the local address, not the public one) you should be able to browse the site.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel