Skip to main content

About Sub Domain Refer to Another IP with Port

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! When you say it "isn't working" what specific problems are you seeing with the DNS? Does it not respond to ping at all, or does it not load the correct content?
    0
  • jimmy_Speedminer
    I tried to ping sub1.domain.com, getting "Ping request could not find host sub1.domain.com. Please check the name and try again." If I use the Track DNS, I am getting Track DNS Enter a domain to look up: sub1.domain.com Error: Unable to run the command "host" domain.com. 3600 IN SOA ns101.xxxhosting.com. abusexxxhosting.com. 2022112203 86400 7200 3600000 86400 Enter a domain to look up: sub.domain.com sub.domain.com. 14400 IN A 192.168.0.1
    0
  • cPRex Jurassic Moderator
    I would confirm the DNS for that domain is being managed on the cPanel server before trying anything else, since if the nameservers aren't at that location nothing else will work. If that is configured properly, you can check the record directly by running this command: dig sub.domain.com @x.x.x.x
    where x.x.x.x is the IP address of your server. If THAT works...then you can try with the nameserver as well: dig sub.domain.com @ns1.yournameserver.com
    to see if that is working. I would expect one of those tests to fail with the output you have provided.
    0
  • jimmy_Speedminer
    I am getting connection timed out. administrator:~$ dig sub.domain.com @192.168.0.1 ; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> sub.domain.com @192.168.0.1 ;; global options: +cmd ;; connection timed out; no servers could be reached administrator:~$
    The following is command without IP administrator:~$ dig sub.domain.com ; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> sub.domain.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29679 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;sub.domain.com. IN A ;; ANSWER SECTION: sub.domain.com. 0 IN A 192.168.0.1 ;; Query time: 4 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP) ;; WHEN: Thu Nov 24 01:50:03 UTC 2022 ;; MSG SIZE rcvd: 64 administrator:~$
    I have tried administrator:~$ dig sub1.domain.com ; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> sub1.domain.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44859 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;sub1.domain.com. IN A ;; AUTHORITY SECTION: domain.com. 888 IN SOA ns101.xxxhosting.com. abuse.xxxhosting.com. 2022112302 86400 7200 3600000 86400 ;; Query time: 11 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP) ;; WHEN: Thu Nov 24 01:56:09 UTC 2022 ;; MSG SIZE rcvd: 108 administrator:~$
    0
  • cPRex Jurassic Moderator
    That output would confirm the nameservers that control the DNS for that domain are not being managed on the cPanel server. You'd have to update your DNS wherever ns101.xxxhosting.com is located.
    0
  • rbairwell
    I think the problem could be the usage of the SRV
    record - not every application works with or recognises them ( see SRV record - Wikipedia ) - "host" part of the name (the left hand side bit) needs to be in a very specific format - _service._proto.
    followed by the domain name. For example, _sip._udp.voiceless.aa.net.uk
    . If it was a "standard" A
    or CNAME
    record, it would most likely work (as you've demonstrated with sub
    ), but you can't specify a port number for those (as they are just "name to ip address" mapping). Basically, what you think you are trying to do can't be done that way. You'll need to setup the DNS record pointing at your server (using a standard A or CNAME) and then do some proxying on the inbound request based on the name (or point towards a secondary IP address and then have port forwarding from there). What, exactly, are you trying to actually achieve?
    0
  • jimmy_Speedminer
    I have existing configurations using ports to direct / land to a specific hosting server. e.g . sub.domain.com: 58888. I was thinking instead of using ports maybe I could create new domain to handle the port which is more meaningful and easier to remember. e.g sub1.domain.com will translate to sub.domain.com:58888 (not direct.).
    0

Please sign in to leave a comment.