LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-29-2013, 10:18 AM   #1
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Rep: Reputation: Disabled
Question Anyone on my internet can't access my self-hosted website


Hello and thanks for taking the time to read this, I have a self hosted website running with the LAMP stack and anyone on my internet can not access my webpage but everyone else(the whole world/US that isn't on my internet) can. I have it portforwarded on port 80 and a westell router
 
Old 09-29-2013, 06:55 PM   #2
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Hi bengalman211, Can it be accessed via IP inside the lan? Could be a dns issue.

Good luck. ;-)
 
Old 09-29-2013, 07:24 PM   #3
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Peacedog View Post
Hi bengalman211, Can it be accessed via IP inside the lan? Could be a dns issue.

Good luck. ;-)
Yes it can be accessed via my laptops internal ip address
 
Old 09-29-2013, 08:36 PM   #4
psycroptic
Member
 
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349

Rep: Reputation: Disabled
yeah you'll need to add a local DNS A record for the LAN that forwards yourdomain.com to the IP of your internal server on the LAN. i had the same problem recently with email running on my LAN
 
Old 09-30-2013, 06:25 PM   #5
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
I'm sorry I'm completely new to this so pretty much what you just said confused me, a lot.
 
Old 09-30-2013, 08:42 PM   #6
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Are you using DHCP on the router?

Good luck. ;-)
 
Old 09-30-2013, 09:43 PM   #7
psycroptic
Member
 
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349

Rep: Reputation: Disabled
so DNS (domain name system) is how a computer translates a domain name (test.com) into an IP address (12.34.56.789). Every device connected to a network has an IP address, it is analagous to a street address of your house. DNS exists so that people can just type test.com into a web browser (or any other internet-related service) instead of having to remember its IP address.

Your problem here occurs because of how certain types of networks have their addresses configured, and by how the DNS servers of the internet operate. A home network typically has 1 primary router connected to the modem; this router actually has 2 IP addresses, a so-called "internal" one which is usually numbered 192.168.0.1 (but could be different), and an "external" one which is assigned to the router by your ISP. In order for the rest of the world to access your server, you probably added this external address to the config page of whoever you bought your domain name from. But if you are located on the network which has this precise IP address, trying to go to the website by name will fail, because your system

1) does a DNS lookup on yourdomain.com, and receives the external address as a result,
2) attempts to connect to this address, but this address is the same address as the one on your own router. The router doesn't know where to route this request, so gives up.

The solution is to run a local DNS server on the LAN. DNS records, at their most basic, contain 2 bits of information; a domain name, and an IP address. The server stores these records, and any client on the network that submits a request for the IP of yourdomain.com gives them the corresponding IP. You need to have a DNS server for the LAN that returns NOT the external IP of your router, but instead the INTERNAL ip of the server on the LAN (192.168.0.2, for example). That way, the rest of the world will get your external IP when they lookup your domain name, but clients on the local LAN will think that it's just another local network device, and will connect accordingly.

Most home routers run super-simple DNS services for you automatically, and rarely allow you to manually configure it. So if you can't modify your router's DNS records, you need to run your own DNS server somewhere on the LAN (it could be on the web server itself, for instance.)

You should look into the DNSMasq software; many home routers and small ISP DNS servers run it, and it's quite simple to configure.
 
1 members found this post helpful.
  


Reply

Tags
can't connect, internet, website


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cant access my website hosted in my server sudeep_mansh Linux - Networking 6 07-26-2013 08:00 AM
my website hosted from home pmarian Linux - Newbie 9 11-13-2010 01:08 PM
viewing an externally hosted website from within a given website andrews-mark Linux - Server 6 10-07-2008 12:11 AM
Can't access web site hosted on Fedora 7 in internet explorer (on windows) kvvsrinivas Linux - Networking 2 08-18-2008 11:49 AM
SOMETIME, I can't access my website from the internet andiheman SUSE / openSUSE 1 05-25-2007 09:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration