Home TechDevOps & DeploymentHow to Map a Domain to an IP Address: A Step-by-Step Tutorial

How to Map a Domain to an IP Address: A Step-by-Step Tutorial

by thuskin

Whether you’re launching a website, setting up a server, or running a self-hosted app like Mailcow, you’ll likely need to map a custom domain to a specific IP address. This process connects your domain name (like example.com) to your server’s IP so that when users type in your domain, they land on the right website or service.

In this tutorial, I’ll walk you through how to point your domain to an IP address using DNS settings.


✅ What You’ll Need

Before we begin, make sure you have:

  • ✔️ A registered domain name (e.g., from Namecheap, GoDaddy, or any registrar)
  • ✔️ A static IP address of your server (e.g., from a VPS provider like DigitalOcean, Linode, etc.)
  • ✔️ Access to your domain DNS settings

🔧 Step-by-Step: Pointing Your Domain to an IP Address

Step 1: Log in to Your Domain Registrar

Go to the website where you bought your domain (e.g., Namecheap, GoDaddy, Google Domains) and log in.

Example: If you use Namecheap, go to https://namecheap.com


Step 2: Go to DNS or Domain Management

Once logged in:

  • Find your domain list
  • Choose the domain you want to configure
  • Click on “Manage” or “DNS Settings” or “Advanced DNS” (this wording varies by provider)

Step 3: Add an A Record

An A (Address) record connects your domain to an IP address.

Add a new A record like this:

TypeHostValue (IP)TTL
A@123.123.123.123Automatic

@ means the root domain (e.g., example.com)
Replace 123.123.123.123 with your actual server IP address

Save the record.


Step 4: (Optional) Add www Redirect

If you want www.example.com to work too, add another A or CNAME record:

Option 1: Add an A Record

TypeHostValueTTL
Awww123.123.123.123Automatic

Option 2: Use a CNAME Record

TypeHostValueTTL
CNAMEwww@Automatic

Step 5: Wait for DNS Propagation

DNS changes can take time—usually a few minutes to 24 hours. You can track changes with:


🧪 Test If It’s Working

After some time:

  • Visit http://yourdomain.com in your browser
  • Use ping or nslookup to confirm:

“`bash
ping yourdomain.com

Leave a Comment