0

I'm hosting my own website and email server at home on my own network. I have ports fowarded and working for the most part. I'm currently using namecheap.com dns servers and foward requests to my IP. I do have dynamic IP from ISP but it only updates when I switch mac addresses on my modem but I sill have IP updater just in case it changes. I'm running my own router - Sophos Home UTM. I conceptually a little confused on my situation. Should the router use the domain of my website and email for example its example.com. This gives every computer localhost.example.com. Or should I leave it with default or nothing? Is this important having my router host name include FQDN so router.example.com? I want to add more servers(vm servers for other things) and be able to use subdomains to call on them from outside of my network. For example I have ports 80,443,25, and 143 to one server. I want to add another server for other stuff. I want to redirect it by subdomin and not have to use NAT foward something weird like this, example.com:9999. Any suggestions? If this isn't a site for this questions let me know where to go thanks for any help.

1

Is this important having my router host name include FQDN so router.example.com?

Usually setting a domain on your router to example.com make all the HOST only requests on your network (e.g. ping somehostname) try to ping somehostname.example.com. This might be useful if you are running one domain only, but is not related or required by what you are trying to accomplish.

I want to redirect it by subdomin and not have to use NAT foward something weird like this, example.com:9999. Any suggestions?

For this the usual way to accomplish this would be to setup internet facing http proxy server (such as nginx) which has 80,443 ports forwarded to it on the router. This proxy would be configured to proxy requests to specific webservers on the network. To explain it a bit better:

  1. You setup website for example.com on webserver1 (192.168.1.1)
  2. You setup website for example.net on webserver2 (192.168.1.2)
  3. You setup nginx on webserver3 (192.168.1.3) to which you forward 80 and 443 ports.
  4. You configure nginx to handle requests for all the domains and proxy them to respective web servers:
    • example.com will be proxied to webserver1 (192.168.1.1)
    • example.net will be proxied to webserver2 (192.168.1.2)

Also, as a sidenote, it's usually a better idea to have these servers in the DMZ instead of port forwarding. In that case, if the servers would get hacked, they would still be unable to access the local area network the server is in.

  • Whats the difference between DNS handling these request and translating vs Reverse Proxy? Essentially I thought DNS was made to do this type of translation or forwarding? What am I missing? Thanks. – user3590149 Jun 29 '14 at 22:10
  • I also took your suggestion about the DMZ. Something I been wanting to do. I have it setup now so should I have the router be part of the domain example.com? – user3590149 Jun 29 '14 at 22:11
  • I know I mention before that i'm using namecheap DNS servers, would it be better to run my own DNS versus reverse proxy? Seems like reverse proxy would be easier. – user3590149 Jun 29 '14 at 22:17
  • @user3590149 - the answer is not related to DNS. It explains what to do with the hostnames after DNS resolves them to your IP address. When you request a website using a browser, it sends the hostname as a HTTP 1.1 header even though it already knows the IP so the web server knows which site you are requesting. This is known as "virtual hosting" and is the most efficient way to use a single IP address for multiple domains. – dartonw Jun 30 '14 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.