0

I have multiple services running that I'd like to access through one port. To make something like this work, I have a proxy server running that can redirect clients based on the url they connect with. For example, a client connecting with service1.mydomain.com would get redirected to service 1, and someone else connecting with service2.mydomain.com would get redirected to service 2. I want to do this so I only have to forward one port (for security, and for ease of adding/removing services).

Right now, I have an SRV record that points to this service (a subdomain, and I've verified that it works). Ideally, I'd like to add CNAME records that point to this SRV record for any and all services running behind the proxy. In other words, if this ip:port of this service changes, I'd like to only change one record since they all use the same ip:port. Is this possible?

Minecraft is a good way to demonstrate, so here is an example of what I don't want. I would like to hide each of these services behind one port and target (using only one SRV record) as opposed to creating several SRV records.

Note: These are not web services. I know browsers can't understand SRV records (and aren't supposed to). I have a client application that understands getting the port number from the record. I have verified that it works on that basis.

1 Answer 1

0

Is this possible?

No. CName is an alternate name for an IN A. Period. It has zero correlation with SRV and in particular it is part of the HOST NAME resolution. At this point and in this part of DNS there is no concept of a port.

Dead end.

SRV records were bolted onto the system and are not integrated into the DNS core.

2
  • I figured this might be the case. Thanks!
    – krizboy12
    Mar 31, 2020 at 15:58
  • 1
    The CName is an alternate name for an IN A. Period. part is not accurate. A CNAME record makes that name into an alias for the specified canonical name. Do note that this happens for that name as a whole, nothing about record types - if a name has a CNAME record, that name is an alias for the other name regardless what record type is requested or what record types exist at the canonical name. It is also used for non-hostname stuff in the wild, such as in reverse zones (alias for name with PTR) and DKIM (alias for name with TXT). Mar 31, 2020 at 21:41

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.