subdomain forwarding

Discussion in 'NZ Computing' started by T.N.O. -, Feb 10, 2004.

  1. How hard is it to setup a subdomain that points to a static IP inside my
    home network?

    Im guessing that I point the subdomain at the gateway, and then port
    forward what I need?

    What if I want all ports? do I have to specify them all?

    Im using a freeBSD box as the gateway.
    T.N.O. -, Feb 10, 2004
    1. Advertisements

  2. Technically it's just one line in the BIND config file, something like

    sub.domain IN A <youraddr>

    How you arrange that administratively is another matter entirely.
    Depending on who is managing your DNS and what their policy/competence
    is, such a request could range from merely difficult to totally
    DNS doesn't normally do ports (OK yes, there are SRV records, but hardly
    anybody seems to use them). So with ENAT you can just point the
    subdomain name at your router, and open up pinholes on that to your
    actual servers.
    Lawrence D'Oliveiro, Feb 10, 2004
    1. Advertisements

  3. yeah I know they're different issues, kinda why I put them as seperate
    questions, but yeah, thanks for that.
    T.N.O. -, Feb 10, 2004
  4. T.N.O. -

    Enkidu Guest

    Do you have control of the DNS for your Domain, and do you have a
    static IP?

    Say you wanted to address a host inside your network. Say Then you tell your external DNS the external address
    of your gateway for Say you are hosting on the gateway box. That is taking up port 80 on that
    address. So to get to web server internally, you'll have to use
    another port, say 8080 and pass that through to You
    can do that either on port 80 or on port 8080. You just have to make
    sure that the internal box listens on the correct port.

    So: (port 80 by default) ---> gateway (stops there) (port 8080, not port 80) --> gateway -->
    internal box (port 80 or 8080).

    Or you can just use externally. (default port 80) --> gateway (stops there). --> gateway ---> (port 80 or 8080)

    Say you want to ssh to an internal machine:

    ssh to (in this case default port 22) --> gateway

    When someone looks up your Domain Name they get an IP
    address. The application decides what port to use. If it's ssh it's
    port 22. If it's a web browser it's port 80. By default. However you
    can use any port. Web browse to 7777 or ssh to 1022. The crucial thing
    is that the Domain Name is just used to look up an IP address.

    When the packet hits your gateway, you can do what you like with it.
    If it's port 80 you can send it to the web site on the server (or more
    correctly the web server listens on port 80). Or pass it on to the
    internal web server (on or whatever). Or leave port 80 for
    the external web server and if it's port 8080, send it to the internal
    web server. If it's port 22 send it to an internal ssh server. It's
    entirely up to you.

    You have two problems to solve:

    Firstly to get the packets to the gateway. You can get one or more
    Domain Names, or use the IP address directly.

    Secondly, you have to decide how to route the packets in the gateway,
    based *solely* on the port number.

    Incidentally, the internal does not have to be, and in practise
    normally isn't, a subdomain. I have an external Domain Name of and an internal one of cliffs.bogus.


    Enkidu, Feb 10, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.