LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Intranet via hostname (https://www.linuxquestions.org/questions/linux-networking-3/intranet-via-hostname-281514/)

novaprime 01-24-2005 02:59 AM

Intranet via hostname
 
I have a registered DNS and Hostname hosted on the internet that points to my networks WAN IP, and port 80 directed to a computer with a webserver on it via my ADSL router. This works fine if I connect from the internet ie www.mydomain.com brings up the page, but if I type www.mydomain.com inside the local network I get "connection refused".

How can I make the site accessable from inside the network (keep in mind the DNS is hosted externally).

Thanks

TheIrish 01-24-2005 05:16 AM

Unluckly, this is quite obvious. Oh, well, I was quite surprised too when it happened to me :o
When you type the url in your web browser, you get resolved with the external public ip so when you try to access it, the prerouting routines will see it like a sort of spoofing... well, it's more complex actually, but let's make it easy!
Anyway, academic explainations apart, you have an easy, ugly way, and a more complex cool way.
The first one is adding in all you hosts files in your lan a resolution like:
www.mydomain.com 192.168.1.2 (assuming 192.168.1.2 is your webserver)
the second one is putting a DNS cache server in your gateway and instruct him to resolve 192.168.1.2 for local requests...

novaprime 01-24-2005 05:19 AM

yeah, thanks. I knew what the problem was, was hoping for a better way around it though.
I ended up sticking a bunch of records in the hosts file for now. Thanks


All times are GMT -5. The time now is 03:24 AM.