DNS – Understanding SRV DNS Record with Custom Ports

dns-hostingdomain-name-systemdyndnssrv-record

I have read up on SRV records, and thinking I understand what they are meant for, I want to achieve the following:

In short: Bind a hostname to another hostname, but changing the port.

I.e. Take into account, I have a hostname of aaa.bbb.com.

On aaa.bbb.com, I have an RDP service port forwarded on port 5000.

So, using RDP, I need to connect to aaa.bbb.com:5000.

I wish to create newhostname.bbb.com IN SRV 1 0 5000 aaa.bbb.com, so that I may connect to newhostname.bbb.com, without specifying the 5000 port.

I wish to create custom mappings like this for all my services on multiple domains.

I have created SRV records with Dyn.com, but they don;t seem to be working. From what I understand, the protocol itself must "support/look for" SRV records? Is that correct?

Questions:

  • Can the above be achieved?
  • Am I missing the point of SRV?
  • If it can be achieved, is it only available to certain protocols?

Best Answer

Protocols (well the applications that implement them) have to be designed to take advantage of SRV records.

Take Outlook for example. When it tries to automatically look up your Exchange server, it will look for an SRV record based on the domain part of the email address (_autodiscover._tcp.{domain}). If found, it will connect to the server and port specified in the SRV record (so SRV records can be used to allow SRV aware applications to run on non-standard ports, transparent to the user).

Most protocols (such as RDP, HTTP, various email protocols, etc) have not been designed to take advantage of SRV records (and it doesn't look like most of them ever will either).

When you RDP to newhostname.bbb.com, the RDP client is just trying to get the A record for newhostname.bbb.com, and connecting to that on the default port, unless you manually specify a different port.

What you would need is the RDP client to look for an SRV record for the hostname that you enter (which would most likely be something like _rdp._tcp.example.com, as all SRV records follow a _service._protocol.aaa.bbb format), and then connect to the host/port specified in that SRV record. This obviously would require changes to the RDP client application.

Related Topic