What is domain pointing?

Published Sep 02, 2024

What is Domain Pointing?

Domain pointing, also known as domain forwarding, is the process of linking a domain name (such as www.example.com) to a specific IP address or another domain. This allows users to access a website using a memorable domain name rather than a numerical IP address. Domain pointing involves configuring DNS (Domain Name System) settings to associate the domain name with the target IP address.

How to Point a Domain to a Static IP in AWS

To point a domain to a static IP in AWS, you typically need to follow these steps:

  1. Obtain a Static IP Address
  2. Configure Your Domain’s DNS Settings
  3. Verify the DNS Propagation

Step 1: Obtain a Static IP Address

If you are using an EC2 instance, you need to assign an Elastic IP address (which is a static IP) to the instance.

1.1 Log in to the AWS Management Console

Navigate to the EC2 Dashboard.

1.2 Allocate an Elastic IP Address

  1. In the left-hand menu, under Network & Security, click Elastic IPs.
  2. Click Allocate Elastic IP address.
  3. Click Allocate. An Elastic IP address will be allocated for your account.

1.3 Associate the Elastic IP Address with Your EC2 Instance

  1. Select the newly allocated Elastic IP address.
  2. Click Actions -> Associate Elastic IP address.
  3. Select the instance or network interface that you want to associate with the Elastic IP address.
  4. Click Associate.

Step 2: Configure Your Domain’s DNS Settings

You need to update your domain’s DNS settings to point to the Elastic IP address. This can be done through the DNS management interface provided by your domain registrar or DNS hosting provider.

2.1 Log in to Your Domain Registrar's Management Console

Navigate to the DNS management section.

2.2 Update the A Record

  1. Locate the section for managing DNS records (this might be under names like DNS Management, DNS Settings, Zone File Settings, etc.).
  2. Add or update an A record (Address record) to point to your Elastic IP address.
  • Host: This is usually @ to represent the root domain (example.com) or www to represent www.example.com.
  • Type: A (Address)
  • Value: The Elastic IP address you obtained from AWS.
  • TTL (Time to Live): Set the TTL to a value such as 300 seconds (5 minutes) for quicker propagation.

Host: @
Type: A
Value: 198.51.100.1 (Elastic IP)
TTL: 300 

Step 3: Verify the DNS Propagation

DNS changes can take some time to propagate across the Internet. You can use various tools to check if the DNS records have been updated correctly.

Tools to Verify DNS Propagation

  1. WhatsMyDNS.net: Enter your domain name to see the current DNS records from various locations around the world.
  2. nslookup: Use the nslookup command in your terminal or command prompt to query the DNS records.

Example:

nslookup example.com

Example: Pointing a Domain to an Elastic IP Using Route 53

If your domain is registered with AWS Route 53, you can follow these steps to point it to an Elastic IP.

1.1 Log in to the AWS Management Console

Navigate to the Route 53 Dashboard.

1.2 Select Your Hosted Zone

Click on Hosted zones and select the domain you want to configure.

1.3 Create or Update an A Record

  1. Click Create record.
  2. Select Simple routing.
  3. Click Next.
  4. Configure the A record:
    • Record name: Leave it blank to point the root domain, or enter www to point www.example.com.
    • Record type: A (Address)
    • Value: Enter the Elastic IP address.
    • TTL: Set the TTL value (e.g., 300 seconds).
  5. Click Create records.

Example: Creating an A Record Using AWS CLI

aws route53 change-resource-record-sets --hosted-zone-id Z3AADJGX6KTTL2 --change-batch '{
  "Comment": "Pointing example.com to Elastic IP",
  "Changes": [{
    "Action": "UPSERT",
    "ResourceRecordSet": {
      "Name": "example.com",
      "Type": "A",
      "TTL": 300,
      "ResourceRecords": [{"Value": "198.51.100.1"}]
    }
  }]
}'
 

Pointing a domain to a static IP in AWS involves obtaining an Elastic IP, configuring DNS settings through your domain registrar, and verifying the changes. By following these steps, you can ensure that your domain correctly resolves to your AWS-hosted resources, providing a seamless experience for your users.