LinuxQuestions.org
Visit Jeremy's Blog.
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 07-20-2017, 10:37 AM   #1
eTomberg
LQ Newbie
 
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
Problem having my google domain name point to my private DNS server, that will run my servers.


So I'm a college student trying to figure out how to run servers (such as my VPN, Web, Email, and a small convo server on a misc. port) all on the same public IP Address. I'm successful without a private DNS for the Web, and VPN servers, but when I started adding in more servers that used the same ports, it got in the way with the port forwarding.

So what I've been attempting to do is have my google Domain accept requests to www.example.com (and example.com), vpn.example.com, mail.example.com, and chat.example.com.

Then forward all those requests to my public IP Router.

Then my router port forward all requests to the private IP addressed DNS server.

THEN my private DNS server to forward those into Private IP Addresses for the specific servers (IE: 192.168.1.15 for web).


I've been trying to find the correct settings, or even understand if this could work. I've been at it for a week on my free time, but still no success. This is really a thorn in my side. For the longest time I've just port forwarded on my router straight to my web server, and I want more control than that. I could really use any help, or if you know of a good guide that can relate.

(I'm using a series of virtual box emulated, Linux Server 16.04 on 2 Windows 8.1 Desktop computers +1 android netbook for PAW fun. I use Webmin 1.850 for the DNS configurations, putty to login console remote, and Teamviewer 12 for remote fixing windows remote.)

Last edited by eTomberg; 07-20-2017 at 10:39 AM.
 
Old 07-20-2017, 11:00 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138Reputation: 2138
Quote:
Originally Posted by eTomberg View Post
Then my router port forward all requests to the private IP addressed DNS server.

THEN my private DNS server to forward those into Private IP Addresses for the specific servers (IE: 192.168.1.15 for web).
That's not how DNS works, it's not a forwarder, it's a library/reference. When person A types in example.com, their machine (machine A) goes to its DNS server, who goes to its DNS server, who goes to its DNS server, until it finally makes its way up the chain enough to find some machine who knows what example.com is, and returns an IP address. Machine A then throws away "example.com", and instead goes to the IP address that the DNS reported back.

DNS requests are on a specific port, 53. That's the only port that should be forwarded to your DNS server. Your entries in the DNS server also need publicly routable addresses, not private addresses. If somebody asks your DNS where "vpn.example.com" is, and your DNS response with "192.168.1.43", that's meaningless to them. In your case, all of your servers are at the same public IP, so all of your DNS entries would look the same.

From what I gather from your post, you simply need to forward the necessary port for each service to the server on your LAN that handles that service. If somebody types in "vpn.example.com" or "mail.example.com" or "chat.example.com", they'll all go to your public IP. If the person typed these into a web browser, it'll always be handled by whatever server you have that's handling port 80. If they typed it into an FTP program using the default port 21, it'll go to whatever server you have handling port 21, etc.
 
1 members found this post helpful.
Old 07-24-2017, 05:16 AM   #3
MrElusive603
LQ Newbie
 
Registered: Jul 2017
Location: United Kingdom
Distribution: Slackware 14.2
Posts: 23

Rep: Reputation: 23
Quote:
Originally Posted by eTomberg View Post
when I started adding in more servers that used the same ports, it got in the way with the port forwarding.
If you only have one public IP address, you need to have the services on different port numbers.

Example:
Server A and B have web sites on port 80. On your router, set one rule to forward inbound HTTP requests on port 80 -> server A port 80, then add a rule to translate inbound HTTP requests on port 8080 -> server B port 80. This is assuming the web server on server B must be hosted on port 80.

Once that's set up, if users want to browse to server B's website, they'll need to browse http://web.example.com:8080 instead.

Obviously I don't know the exact ins-and-outs of your deployment, so I can only speculate based on your post.

Also as suicidaleggroll said, you shouldn't have DNS entries for private IP addresses unless they're on your own private network(s). ISPs will drop traffic destined for local/private IP ranges (192.168.X.X, 172.16.X.X - 172.32.X.X and 10.X.X.X).

Last edited by MrElusive603; 07-24-2017 at 06:05 AM. Reason: Mistake in what I posted regarding private DNS entries.
 
Old 07-24-2017, 07:59 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Some excellent resources at http://www.linuxhomenetworking.com/
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to run a dns server one IP to host my domain webserver. JohnF718 Linux - Networking 1 10-03-2011 06:56 AM
Creating a bogus DNS domain inside private address range network zogness Linux - Networking 13 10-16-2009 01:34 PM
Can someone point me to good documentation for setting up DNS servers michael.wegemer Linux - Newbie 1 02-27-2009 12:34 PM
DNS Questions Multiple DNS Servers with single domain linuxcrazyguy Linux - Networking 1 01-27-2009 12:21 PM
Migrating domain to my own DNS servers... Erik Thorsson Linux - Networking 1 12-18-2004 03:06 AM

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

All times are GMT -5. The time now is 12:53 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