Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to host a small personal website at home. One basic problem I am hitting is, From inside home network, I cannot access my domain name. I have to use the local ip (something like 192.168.1.4) to access the website. This ip is the desktop which is hosting the website. Because of this mapping, I have issues setting up a simple wordpress blog on it too.

How do I get past this issue?

edit:0 when I try to access www.example.com (my domain) from within my home network, I get redirected to my router login.

PS: 1) I am using dyndns service to map my non-static ip to my domain name. 2) My portforwarding works fine.

share|improve this question
add comment

9 Answers

up vote 8 down vote accepted
+50

On your computer inside your router setup an entry in your hosts file to point to your server's internal ip address. This means that it overrides the DNS entry from the public internet.

share|improve this answer
    
You mean my server (where I am hosting my site - www.example.com) behind the router should have an entry in its /etc/hosts file, right? can you please give me an example? my server's internal ip is 192.168.1.4. How should the entry look? –  hari May 27 '12 at 23:16
    
192.168.1.4 www.example.com –  Noodles May 27 '12 at 23:44
    
Tried that, its still pointing to the router login. –  hari May 27 '12 at 23:53
    
You may need to restart your browser, it has its own DNS cache. You can try and ping www.example.com and see if it returns the correct ip. If in doubt reboot your computer. –  Noodles May 28 '12 at 3:21
    
I tried clearing cache. ping to www.example.com returns my external public ip. Does that sound correct? –  hari May 28 '12 at 19:27
show 4 more comments

According to ref 1, ref 2, port forwarding only works from an external network. Just use the local IP for testing purposes. There's nothing wrong with your configuration; it's just the way port forwarding is designed.

share|improve this answer
1  
On another note: your ISP's Terms of Use likely forbid running any kind of server from your residence. There are plenty of free (or nearly free) alternatives. For example, Google App Engine, or Amazon AWS. –  Wackidev May 21 '12 at 22:15
    
I have no clue where you are heading with your answer. Sorry but it does not make sense. –  hari May 23 '12 at 7:05
    
Your problem could be the result of a hundred different things. I just listed the first few things I would do if I were you. Have you tried any of them? –  Wackidev May 24 '12 at 13:20
    
All of them. Thanks for your help. –  hari May 25 '12 at 17:59
1  
No problem. If you provide more information I may be able to suggest a more effective remedy. What does it say when you try to access your domain? "Server not found" "404" "Page doesn't exist" etc. (BTW: If you're using IE it sometimes isn't as informative as Chrome or Firefox. You might want to try using one of those for a more helpful readout.) –  Wackidev May 25 '12 at 22:56
show 1 more comment

If you don't want to play with hosts file, Split DNS is the solution.

The easiest way is to install Dnsmasq on your local server and reconfigure DHCP on your router to to use it as DNS server.

Dnsmasq should forward queries to send queries to your name servers, then study configuration file how to override DNS records.

share|improve this answer
add comment

On the computer you are using to access your server (not on the server itself) add a line to its hosts file like:

192.168.1.4 www.example.com

Depending on your OS, the hosts file can be found in a number of locations. Use the table on Wikipedia to track it down.

share|improve this answer
add comment

I hope I understand what you meant;

your dyndns service points to your external ip (1.2.3.4 as example), you need to configure Port forwarding on your router.

Maybe your Webserver needs an alias for example.dyndns.org?

share|improve this answer
    
I am not quite getting what you mean here. I have portforwarding enabled/working. From outside, I can see my www.example.com thingi. Point is, I cannot check www.example.com from inside home network. I have to do 192.168.1.4. –  hari May 21 '12 at 21:58
    
Can you please elaborate on "alias" part? –  hari May 21 '12 at 22:00
    
Sry I didn't understand the question right. So a work around would be to add C:\Windows\System32\drivers\etc\hosts (on W7) 192.168.1.4 name your want, (localhost, foo.dyndns.org) –  MemLeak May 21 '12 at 22:04
    
Thanks for the help but I didn't get you. you mean, I should make it point in a way I could call it localhost? why so? –  hari May 21 '12 at 22:05
    
Maybe a dns resolving problem? Sry –  MemLeak May 21 '12 at 22:06
show 1 more comment

Its to do with the way port forwarding works differently inside and outside the your network. the router routes correctly from outside the network (WAN) to the selected LAN IP.

I would suggest using a service such as megaproxy in order to test your site from a virtual external location.

Personally i use a NO-NAT connection, which gives me 8x full external internet IP addresses that i can assign to devices, such as web severs and VIOP access boxes. i then have another router running NAT to create an internal network and protect my PC, laptops etc inside the local LAN.

I use ENTA.net for this - very good UK based service, decent price (but a bit more than generic cheap-o home adsl, though not much) and their service is designed for doing this too, so you are well within their usage policies.

share|improve this answer
add comment

Alternative Solution:

Out of personal experience, I would choose No-IP to direct your domain to your server.

No-IP's Plus package is something that I have used to eliminate the problem that you are encountering. I read that you are using Dyn's DNS service -- if that cannot be changed, I understand. No-IP's service is much easier for the average person to implement as a www.domain.com to server solution.

If you should use this method, be sure to remove all of your information from the Dyn DNS service to make sure that Dyn DNS is not trying to manage your server and domain at the same time.

You should be able to solve all of your issues using this service. Here is a link: No-IP Plus

Check with your ISP to make sure you are not in violation of your User Agreement and their Terms of Service by self-hosting your domain!

share|improve this answer
add comment

Disable remote management in your router settings, or move it to a different port (such as 8080)

share|improve this answer
add comment

I am hosting a website on one of my home pc's using a dynamic dns service as well. All I did was:

  1. Forward external requests on port 80 to the pc hosting the site in the router setup. For example (wan ip:80) --> 192.168.1.1:80.

  2. Open port 80 in windows firewall on the server pc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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