#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0

    Help:subdomains to one public IP


    Hi all,

    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)

    Thanks!
    Dan
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0
    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?

    Thanks
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0
    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?

    Thanks
    Dan
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0
    Originally Posted by E-Oreo
    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.
    so if i want the user to type in example1.mydomain.com
    or example2.mydomain.com

    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?

    Thanks!
    Dan
  14. #8
  15. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0
    Originally Posted by E-Oreo
    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.
    Excellent so I think im understanding it now,

    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.

IMN logo majestic logo threadwatch logo seochat tools logo