Sub-domain Help

Discussion in 'Systems Administration' started by xSinclare, Mar 31, 2017.

  1. Hey, guys! I didn't expect myself to post here, but this issue is really bugging me, so I thought I'd just go ahead and give it a whirl.

    On my VPS I have 3 different instances running on 3 differents and I want to use it all with one domain with subdomains. For security purposes and such, I'm just gonna use 25565, 25566 and 25567 for example. Basically, I'm trying for it to work like this:

    Code (Text):
    instance1.thenerdcave.us  (thenerdcave.us:25565)
    instance2.thenerdcave.us (thenerdcave.us:25566)
    instance3.thenerdcave.us (thenerdcave.us:25567)

    However, I do have a website running on this VPS via a different domain name as well and whenever I have one domain that is personal (thenerdcave.us) and another domain (which I won't list) that is used for a server I am currently developing. Whenever I try and visit one of those instances it automatically reverts to the domain I am using for a server I am developing. Not the subdomains I setup. I've tried setting up A records like this:
    Code (Text):
    instance1   111.222.333.444
    instance2   111.222.333.444
    instance3   111.222.333.444

    And then I set up all my SRV records like this:
    Code (Text):
    _service1._tcp.thenerdcave.us. 1800 IN SRV 0 5 25565 instance1.thenerdcave.us.
    _service2._tcp.thenerdcave.us. 1800 IN SRV 1 5 25566 instance2.thenerdcave.us.
    _service3._tcp.thenerdcave.us. 1800 IN SRV 2 5 25567 instance3.thenerdcave.us.
    (Not sure if that SRV setup is correct. I use Namecheap for my DNS records).

    So guys. How exactly can I achieve this if I'm using two different domain names on the machine? In the future I'll be moving the website I am developing off the machine, so it won't be here forever as this VPS is my personal VPS I use to mess around. Any and all help is appreciated!
     
  2. For minecraft you need to use (in BIND format):
    Code (Text):
    _minecraft._tcp.thenerdcave.us. 1800 IN SRV 0 5 25565 instance1.thenerdcave.us.
    ^Just a example

    For 25565 ports please don't use a SRV but a A record. Every 1800 seconds will the record rotate if it has multiple ones with the tcp. Please keep that in mind
     
  3. Okay. Gotcha. However, I used Minecraft ports only as examples. I have 3 differents ports that aren't Minecraft ports that I'm trying to do this with. One is Cryptkeeper's Minetrack, Sinusbot web panel for Discord and TeamSpeak bots and a Hastebin server. They all have different ports that I'm having issues configuring properly.
     
  4. Try to use nginx reverse proxy for the bots and hastebin server
    Code (Text):

        location / {
            proxy_pass http://111.111.111.111:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    That snippet came from: https://www.digitalocean.com/commun...-proxy-for-apache-on-one-ubuntu-14-04-droplet
     
  5. I will look into this. Thank you.