Windows VPS & RDP

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:3389. Covers TTL, IP changes and testing with the hosts file.

BeginnerWindows server4 min read

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:3389 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.
  • Your server's public IP address from your VPS provider's control panel.
  • A Remote Desktop client. servers accept Remote Desktop on TCP port 3389, and a domain name does not change that. You still add :3389.

Note: DNS only turns a name into an IP address. It does not carry a port, so the port always goes in your Remote Desktop client.

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 3389.

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:

Bash
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:3389

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

Mac, iPhone, iPad and Android

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

Update saved connections

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

full address:s:rdp.example.com:3389

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:
   203.0.113.10    rdp.example.com
  1. Save, then connect to rdp.example.com:3389.

Warning: Remove the line when you finish testing. A forgotten hosts entry keeps sending you to the old IP even after you change public DNS.

Check it works

Test the port by name:

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

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 :3389, 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 MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.