LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2018, 01:05 PM   #1
sternfanatic
LQ Newbie
 
Registered: Feb 2018
Location: New Jersey
Distribution: Ubuntu 16.04 LTS
Posts: 3

Rep: Reputation: Disabled
Unhappy DNS Issue?


Hello:
I am fairly new to Linux/Ubuntu. I have an Ubuntu LTS 16.04 setup with apache. I have 3 domains. They are pointed to my Public IP address and I use namecheap dns service as I am on a dynamic IP address via cable. When I attempt to contact any of my 3 domains, I cannot connect to them. I get ERR_CONNECTION_TIMED_OUT I have set up port forwarding on port 80 to my Ubuntu machine (static)IP 10.0.0.111 If I type 10.0.0.111 from my windows 10 computer (static) IP (10.0.0.110) I can see my index.html page. But only for one website, not the other two.

When I do a nslookup on my domains, it resolves to my public IP.

What am I doing wrong? I have been searching for help for weeks.
Attached Thumbnails
Click image for larger version

Name:	portfwd.png
Views:	27
Size:	164.9 KB
ID:	27008  

Last edited by sternfanatic; 02-15-2018 at 03:42 PM. Reason: added port forwarding photo
 
Old 02-15-2018, 01:35 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
That browser error usually indicates something is wrong on the system in question. You might have messed up the port forwarding. Did you use iptables? Post the commands. You can also have that problem due to browser issues such as history and cookies. You can clear that out of the browser. But it's probably the port forwarding is askew.

Can you connect to other websites?

I don't know if hosting multiple domains on a single server works if they all resolve to the same IP.
 
1 members found this post helpful.
Old 02-15-2018, 02:36 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I agree. Given that you can resolve with your private IP address from within your network, the issue must be with the port forwarding configuration. We presume that neither your public IP nor any domain name will resolve, correct?

Of course, when you use the IP instead of a domain name, only either the default domain, if there is one, or the first virtual domain will be shown. You won't be able to see other virtual domains without using a domain name. You can test this by adding your domains to the hosts file on your windows 10 PC.
Use notepad to edit C:\Windows\System32\drivers\etc\hosts and add lines at the end:
Code:
10.0.0.111 domain1.com
10.0.0.111 domain2.com
10.0.0.111 domain3.com
BUT, then your PC will always work, and you won't be able to use it to test/resolve the forwarding issue, so you probably won't want to leave those entries in place

As AwesomeMachine says, show us what you did to implement the port forwarding.

My production web server hosts ~70 domains all resolving to a single IP.
 
1 members found this post helpful.
Old 02-15-2018, 03:56 PM   #4
sternfanatic
LQ Newbie
 
Registered: Feb 2018
Location: New Jersey
Distribution: Ubuntu 16.04 LTS
Posts: 3

Original Poster
Rep: Reputation: Disabled
thank you

Thank you for your help today. I have posted a picture of my router settings concerning the port forwarding of my Ubuntu machine (10.0.0.111)

The domain names will not resolve on the Ubuntu machine through firefox either.

I did edit my hosts file on my windows 10 machine and added

10.0.0.111 mydomain1.com
10.0.0.111 mydomain2.com
10.0.0.111 mydomain3.xyz

As you said and that does work when I type the domain url's in the browser.

Thank you again for your help.
I posted the url's here so you can get the full idea of what is going on.
My public ip is 73.1.1.1 and they resolve to this IP when I do nslookup.I don't know where the problem is since this works when I edit the hosts file, it makes me think it is a DNS problem somewhere, or perhaps my ISP (Comcast) blocks this as this is a home internet account. I do not know. But because I can view these url's with the hosts file edited, I feel the Ubuntu machine is working as it should.

Any help will be greatly appreciated. Mike

Last edited by sternfanatic; 02-15-2018 at 05:37 PM.
 
Old 02-15-2018, 05:13 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Hmmm. All three of those domains respond for me via cox, displaying a page that says:
Quote:
Success! www.eachdomain.com works! new
Is that what's supposed to happen,Mike? Do they work for you now?

PS You should probably edit your post to obfuscate your domains and public ip address...

Also, I wouldn't open up either FTP or telnet ports to public access at all...if you need public access to that server, set up ssh and use sftp/scp

Last edited by scasey; 02-15-2018 at 05:20 PM.
 
1 members found this post helpful.
Old 02-15-2018, 05:35 PM   #6
sternfanatic
LQ Newbie
 
Registered: Feb 2018
Location: New Jersey
Distribution: Ubuntu 16.04 LTS
Posts: 3

Original Poster
Rep: Reputation: Disabled
Smile Success

Thank you for your help. Somehow, apparently I did fix it. I did find a typo error in my hostfile, which I fixed after your first post. I do know to block ports 21 and 23 I opened them during testing. Also My public IP info. Thanks again. I really appreciate your help here.

Mike
 
Old 02-15-2018, 08:45 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Glad that you got it working!
 
1 members found this post helpful.
Old 02-16-2018, 10:46 AM   #8
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,970

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by sternfanatic View Post
Thank you for your help. Somehow, apparently I did fix it. I did find a typo error in my hostfile, which I fixed after your first post. I do know to block ports 21 and 23 I opened them during testing. Also My public IP info. Thanks again. I really appreciate your help here.

Mike
You can mark it solved.
 
  


Reply



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] repolication between primary DNS and secondary DNS issue Gil@LQ Linux - Server 10 05-27-2012 02:28 PM
DNS issue h725 Linux - Server 1 11-02-2009 04:09 PM
DNS issue - DNS works perfect on server but not on any other computer jtneal Linux - Networking 3 03-15-2008 03:30 PM
DNS issue or caching issue? AZDAVE Linux - Networking 7 10-02-2004 12:28 AM
dns issue no.2 iquadri1 Linux - Networking 0 09-29-2001 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:10 AM.

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