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.
- Choose Add record.
- Set the fields:
- Type:
A - Name / Host:
rdp(this makesrdp.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.
- 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:
Resolve-DnsName rdp.example.com -Type AThe IPAddress column should show your server IP. On macOS or Linux:
dig +short rdp.example.comThe output should be a single line with 203.0.113.10.
Connect using the name
Windows
mstsc /v:rdp.example.com:3389Or 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:3389The 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:
- A day ahead, lower the TTL to 300.
- Once the new server is ready, change the A record value to the new IP.
- Wait for the old TTL to pass, then connect with the same name.
- 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.
- Open Notepad as Administrator.
- Open
C:\Windows\System32\drivers\etc\hosts(set the file filter to All files). - Add a line at the bottom:
203.0.113.10 rdp.example.com- 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:
Test-NetConnection rdp.example.com -Port 3389You 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-DnsNameand check the record name and value. Flush your local cache withipconfig /flushdnsand 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
- Understand the certificate prompt: The identity of the remote computer cannot be verified explained.
- Save the name in a one-click file: Save a Remote Desktop connection as a one-click shortcut.
