December 11th, 2011, 04:42 PM
Help:subdomains to one public IP
Im extremely new when it comes to networking. I am attempting to setup about 6 subdomains all pointing to one static IP address, each of my subdomains are on individual computers, I have one internal DNS server, and my domain is managed by godaddy.
When Im on a computer within my intranet, I can access all subdomains successfully.
I have a router, I have opened the correct ports to each individual private IP address. I also have assigned my DNS server as a DMZ.
In godaddy, I set both nameserver options to my local DNS server. NS1.mywebsite.com and NS2.mywebsite.com (NS2 points to empty address of which I own but am not currently using). Also all A and MX records are pointing to the public IP address.
I changed the nameservers in godaddy about 18 hours ago.
Now when I do a DNS loookup on any of my subdomains I am getting their correct internal private IP address, and its saying that it cannot access private IP addresses.
So my question is this, how can I properly set this up so all my subdomains are accessible by the internet? or is this a matter of waiting for the DNS to re-cache (the 24-48 hr waiting period)
December 11th, 2011, 06:55 PM
You can't do exactly what you're trying to do. If your DNS server is configured to return private IP addresses the subdomains will not be accessible from the internet; a computer on the internet cannot access a server using its private IP address.
Each of your subdomains must point to a public IP address (they can point to the same public IP address). This means that you either need a different public IP address for each of your internal servers, or you need a single gateway server that is capable of acting as a proxy server for all of your internal servers.
A router is capable of forwarding packets based on port, so with only a router you could have separate internal physical servers running web servers on different ports (ex: 80, 81, 82, etc.), but you couldn't make it work with the web servers running on the same port, even with different domains.
December 11th, 2011, 09:00 PM
So how would I go about assigning the router to forward diff ports?
by that I mean setting up the start and end ports, lets say we have 3 subnets, with webservers on 80, 81, and 82, how would I setup the start and end ports in my router?
December 11th, 2011, 10:20 PM
You'll have to consult the manual for your router, every model is a little bit different. Normally the router configuration will have a section literally called "Port Forwarding" that you would use to do this. You'll probably need to disable the DMZ to use port forwarding.
When configuring it, you'll enter a port number and a destination IP addresses; then any requests that come in on that port will be forwarded to the destination IP address. The destination IP is the internal IP of your web server.
Some routers might allow you to forward a range of ports, some might require you to configure them one by one. You'll need at least one rule per destination IP address regardless of how you do it.
Some routers might allow you to use different external and internal ports; for example, a request coming in on port 82 might be forwarded to an internal web server that is running on port 80. Most consumer grade routers do not support this though, which means you will need to modify your web server configuration to serve content over the non-default port number.
December 11th, 2011, 10:33 PM
My routers running DD-WRT, so I understand what your saying.
Does this mean though that when i type in the website I will need to go ahead and type in mysubdomain.mydomain.com:82?
Is there anyway to register a cname entry for this?
December 11th, 2011, 11:10 PM
Yes, if your server is running on something other than port 80 you will need to type the port number.
No, you cannot map to a port number with DNS records of any type.
December 11th, 2011, 11:41 PM
so if i want the user to type in example1.mydomain.com
Originally Posted by E-Oreo
with no port designations after the name, and I am hosting them all from the same public IP address, my only choice would be to setup a proxy server?
December 12th, 2011, 12:36 AM
Right, the router will route all of the incoming requests on port 80 to the same machine. That machine is free to function as a proxy and farm those requests out to other machines on the network to do the actual processing work.
This isn't limited to just port 80, but since it sounds like you're setting up a web server that's the relevant port in this case.
December 12th, 2011, 01:28 AM
Excellent so I think im understanding it now,
Originally Posted by E-Oreo
Do you have any step by step or links on proper way to setup the proxy? Im looking to set it up using webmin and squid but there really are no good step by steps online,
What im having a problem really understanding is how to get the proxy to redirect to specific hosts within my intranet, I understand how to forward port 80 to the proxy.