Connect to Remote Desktop with a domain name instead of an IP

Point a DNS A record such as rdp.example.com at your server and connect as rdp.example.com:12230. Covers TTL, IP changes and testing with the hosts file.

  • Beginner
  • Windows VPS · Admin RDP
  • 4 min read

By RunRacks Team · Published

An IP address like 203.0.113.10 is hard to remember and easy to mistype. If you own a domain, you can create a name such as rdp.example.com that points at your server and connect with rdp.example.com:12230 instead. If the server IP ever changes, you update one DNS record and every saved connection keeps working.

Before you start

  • A domain you own, for example example.com, and access to its DNS settings. This is usually at your domain registrar or a DNS provider such as Cloudflare. RunRacks does not sell domains.
  • Your server's public IP address from the Dashboard.
  • A Remote Desktop client. RunRacks servers accept Remote Desktop on TCP port 12230, and a domain name does not change that. You still add :12230.

Create the A record

Sign in to your DNS provider and open the zone for example.com. Menu names differ between providers, but the record is the same everywhere.

  1. Choose Add record.
  2. Set the fields:
  • Type: A
  • Name / Host: rdp (this makes rdp.example.com)
  • Value / Points to: 203.0.113.10 (your server IP)
  • TTL: a short value such as 300 seconds while you test. Some providers call this Auto.
  1. Save the record.

If you use Cloudflare, set the record to DNS only (grey cloud). Cloudflare's normal proxy handles web traffic and will not pass Remote Desktop on port 12230.

Check the name resolves

New records usually appear within minutes, but caches can take up to the TTL to update. Check from Windows PowerShell:

PowerShell
Resolve-DnsName rdp.example.com -Type A

The IPAddress column should show your server IP. On macOS or Linux:

Terminal
dig +short rdp.example.com

The output should be a single line with 203.0.113.10.

Connect using the name

Windows

PowerShell
mstsc /v:rdp.example.com:12230

Or type rdp.example.com:12230 in the Computer box of Remote Desktop Connection.

Mac, iPhone, iPad and Android

In Windows App, add a PC and enter rdp.example.com:12230 as the PC name.

Update saved connections

Edit any saved .rdp file so the address line reads:

Text
full address:s:rdp.example.com:12230

The first time you connect by name, the client shows a certificate warning again. That is expected: the client sees a new name and the server's self-signed certificate was issued to the computer name, not to your domain. Check the details and accept it. To remove the warning for good, see Install a trusted TLS certificate for Remote Desktop.

TTL and IP changes

The TTL tells other DNS servers how long they may cache your record.

  • Short TTL (300 seconds): changes spread quickly. Use this before a planned move to a new server.
  • Longer TTL (3600 seconds or more): fewer lookups, but a change can take that long to reach everyone.

When your server IP changes, for example after you move to a new server plan:

  1. A day ahead, lower the TTL to 300.
  2. Once the new server is ready, change the A record value to the new IP.
  3. Wait for the old TTL to pass, then connect with the same name.
  4. When everything works, raise the TTL again if you want.

Test before DNS is ready with the hosts file

You can try the name on your own PC before changing public DNS, or point it at a new server early. Windows reads C:\Windows\System32\drivers\etc\hosts before asking DNS.

  1. Open Notepad as Administrator.
  2. Open C:\Windows\System32\drivers\etc\hosts (set the file filter to All files).
  3. Add a line at the bottom:
Text
   203.0.113.10    rdp.example.com
  1. Save, then connect to rdp.example.com:12230.

Check it works

Test the port by name:

PowerShell
Test-NetConnection rdp.example.com -Port 12230

You should see RemoteAddress showing your server IP and TcpTestSucceeded : True. Then connect with your client and sign in.

Troubleshooting

  • "Remote Desktop can't find the computer": the name does not resolve yet. Run Resolve-DnsName and check the record name and value. Flush your local cache with ipconfig /flushdns and try again.
  • Name resolves, but the connection fails: you left off :12230, or the record is proxied through a CDN. Use the plain DNS-only record and include the port.
  • Old IP keeps coming back: a hosts file entry or a cached record. Check the hosts file and wait for the TTL to pass.
  • Certificate name mismatch warning: normal with the default self-signed certificate. Accept it after checking, or install a trusted certificate for that name.

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Windows VPS & RDP

Allow or block multiple RDP sessions for one user

Understand why a new Remote Desktop login takes over your old session, how the single-session policy works on Windows Server, and which setting suits a team.

  • Advanced
  • Windows VPS
  • 5 min read