LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   DNS Issue? (https://www.linuxquestions.org/questions/linux-newbie-8/dns-issue-4175623799/)

sternfanatic 02-15-2018 01:05 PM

DNS Issue?
 
1 Attachment(s)
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.

AwesomeMachine 02-15-2018 01:35 PM

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.

scasey 02-15-2018 02:36 PM

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.

sternfanatic 02-15-2018 03:56 PM

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

scasey 02-15-2018 05:13 PM

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

sternfanatic 02-15-2018 05:35 PM

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

scasey 02-15-2018 08:45 PM

Glad that you got it working!

RandomTroll 02-16-2018 10:46 AM

Quote:

Originally Posted by sternfanatic (Post 5820319)
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.


All times are GMT -5. The time now is 06:35 AM.