LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-02-2009, 10:50 AM   #1
tryangle
Member
 
Registered: Feb 2003
Location: Penns Woods
Distribution: RedHat OpenSuse Ubuntu Mepis
Posts: 34

Rep: Reputation: 15
www ilo local ip to access website on lan


I can access a website hosted in-house by using the internal ip. I'd like to be able to resolve the Domain name (ie www.sitename.com) from the lan instead of using the internal ip though. I've been checking around, and I'm not sure... but what I'd like to configure might be referred to as Split Horizon? I've also found info about setting up a proxy... Zorp? I've also found info related to setting up two instances of tinydns or one instance of BIND and editing /etc/hosts? I'm not sure... maybe this isn't even a Linux question... perhaps there's a router setting that will accomplish this?

I guess I'm looking for a little direction here... not wanting to make it more complicated than it needs to be, and certainly not wanting to make all kinds of changes and not even accomplish what I'd like to do.

Thanks in advance for any help on this...
Tryangle
 
Old 09-03-2009, 10:24 AM   #2
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 202

Rep: Reputation: 35
If you're talking about 1 computer, you can add the name/ip to your /etc/hosts file. If there are several computers, are you using your ISP's DNS server, or your own?
 
Old 09-07-2009, 02:00 PM   #3
tryangle
Member
 
Registered: Feb 2003
Location: Penns Woods
Distribution: RedHat OpenSuse Ubuntu Mepis
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks Suncoast for picking up on this...

I setup a Server for a friend to host his website. I have it doing DNS with BIND named. The thing is, he's unable to run a spider to index his site because it returns the lan address. I added the Server's internal IP to /etc/hosts but now it gets stuck on the router address of 10.0.0.2 for some reason... and asks for a username and password.

Thanks again for any help...
Tryangle
 
Old 09-07-2009, 02:06 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
Quote:
ut now it gets stuck on the router address of 10.0.0.2 for some reason... and asks for a username and password.
Seems to me this is the login page for the webinterface of the router.
Is the website reachable from the outside?
What is the IP from the server?
What is the content of /etc/hosts ?
 
Old 09-08-2009, 08:43 AM   #5
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 202

Rep: Reputation: 35
So you have a public Web server behind NAT, and you want both internal and external hosts to resolve by name to that server. Are you running Apache with VirtualHost directives? Because the easiest way I know to do this is to create a unique Extranet name for the private IP and add a VirtualHost directive for it in Apache. Or if you just have a couple of computers on the Intranet or Extranet, you can simply add a static host record to your local client hosts file with the private IP address, and let bind resolve external DNS queries to the public IP address.

Last edited by Suncoast; 09-08-2009 at 08:54 AM. Reason: Clarify
 
Old 09-08-2009, 09:08 AM   #6
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 202

Rep: Reputation: 35
Quote:
Originally Posted by tryangle View Post
Thanks Suncoast for picking up on this...

I setup a Server for a friend to host his website. I have it doing DNS with BIND named. The thing is, he's unable to run a spider to index his site because it returns the lan address. I added the Server's internal IP to /etc/hosts but now it gets stuck on the router address of 10.0.0.2 for some reason... and asks for a username and password.

Thanks again for any help...
Tryangle
I'm still trying to make sense of this last part. You should have Bind resolving the Fully Qualified Domain Name to a Public IP address. You should have your local Workstations, not the Servers, with a custom hosts file that manually resolves your server name to the Private IP address. And you should have port forwarding setup on the Router to forward port 80 and possibly 443 to your Web Servers private Intranet IP Address.
 
Old 09-15-2009, 07:16 PM   #7
tryangle
Member
 
Registered: Feb 2003
Location: Penns Woods
Distribution: RedHat OpenSuse Ubuntu Mepis
Posts: 34

Original Poster
Rep: Reputation: 15
Sorry for the delay in my reply...

# /etc/hosts
66.59.110.177 sun.questudio.com sun
192.168.1.234 sun.questudio.com sun
127.0.0.1 localhost
127.0.1.1 sun

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

I'm running Ubuntu. The website is accessible from the outside... www.surchin.net But when I type in the external address from the LAN, I get this message on a login screen... "The server 10.0.0.2 at Viking requires a username and password." I have no Viking, that I know of. I have a Linksys router, and I'm able to log into it at 192.168.1.1 However, as I've looked through the configuration files of the Linksys, I noted the 10.0.0.2 address, but I don't understand what it's for. I have a password for logging in to 192.168.1.1 but not for 10.0.0.2 so when I fail to login, it takes me to http://10.0.0.2/hag/pages/home.htm with a "401 Unauthorized" message.

I sorta understand some of what's recommended here... I have a virtual host setup for Apache, so I'm understanding that I need to have a "duplicate" entry for the site, associated with the internal ip?

Thanks again for any help on this...
Tryangle
 
Old 09-17-2009, 10:26 AM   #8
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 202

Rep: Reputation: 35
Arrow

I can only guess that your internal request is being routed externally, and the ISP's network is able to route that IP address to a location other than yours.

Try just this for your internal client:
Code:
192.168.1.234   sun sun.questudio.com.
127.0.0.1       localhost


Quote:
I sorta understand some of what's recommended here... I have a virtual host setup for Apache, so I'm understanding that I need to have a "duplicate" entry for the site, associated with the internal ip?
This would work also, and would be better for a larger group of clients needing internal access while maintaining concurrent external access to the same material. A www.sitename.com and a www2.sitename.com virtualhost directive would accomplish this. Then set them both to use the same virtual directory. DNS would resolve www to the external IP, www2 would resolve to the internal IP address.
 
Old 09-17-2009, 02:00 PM   #9
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
Indexing should be done on the basis of the domain name not the IP address, since tomorrow there is a distant possibility that you change the host.

You can set up a single instance of bind to serve for both the internal/external domains, so that in case you resolve www.example.com from external, it resolves to a public IP, and from internal it resolves to a private IP. As said by @Suncoast, internal request is being routed externally, to a location other than yours.

Regards,

--
Prasanta
 
Old 09-18-2009, 09:11 PM   #10
tryangle
Member
 
Registered: Feb 2003
Location: Penns Woods
Distribution: RedHat OpenSuse Ubuntu Mepis
Posts: 34

Original Poster
Rep: Reputation: 15
Thank you for the responses...

I have had it setup to resolve the site internally as lan.surchin.net and that has worked fine all along.

The thing is, when I index the site internally it returns pages with lan (or www2) as part of the address path that can't be accessed externally... and if I index it externally it returns pages with www as part of the address path that can't be accessed internally.

I know it can work, because I had it setup using a different router and another server about 4 years ago that got fried. I only did it that one time, and don't remember how I got it to work, but I was able to resolve the exact same www address both internally and externally. I'm wondering if it had something to do with having dansguardian and squid on the other box... something about the proxy? I just don't know.

That's my dilemma,
Tryangle

Last edited by tryangle; 09-18-2009 at 09:19 PM. Reason: Typo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Local Port on Website Garibaldi3489 Linux - Networking 1 11-29-2007 01:43 PM
Unable to access website from local network pioniere Linux - Networking 8 07-31-2006 09:09 AM
restricting website access from local machine Stridier Linux - Networking 9 01-30-2006 04:26 AM
Apache2: LAN machines cannot access website Akhran Linux - Newbie 1 10-13-2005 05:39 AM
How to restrict website access in a LAN? mummrra Linux - Networking 3 12-05-2003 01:56 PM


All times are GMT -5. The time now is 02:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration