Creating a forward DNS record involves adding a mapping between a domain name and an IP address to your DNS server, enabling users to access your server by name instead of directly using its IP address. Here's how to do it:
Steps to Create a Forward DNS Record
-
Open DNS Manager: Access the DNS Management console on your DNS server. The specific steps will depend on your operating system (e.g., Windows Server). Generally, you can find it via Server Manager -> Tools -> DNS.
-
Navigate to Forward Lookup Zones: In the DNS Manager, locate and expand the server name in the left pane. Then, expand "Forward Lookup Zones."
-
Create a New Zone (if needed): If you don't already have a zone for your domain, right-click on "Forward Lookup Zones" and select "New Zone..." The New Zone Wizard will appear.
- Zone Type: Select "Primary Zone" (or "Secondary Zone" if you are creating a secondary DNS server).
- Zone Name: Enter the name of your domain (e.g.,
example.com
). - Zone File: Accept the default settings for the zone file name.
- Dynamic Update: Choose the appropriate setting for dynamic updates (usually "Allow only secure dynamic updates" if using Active Directory).
-
Create a New Host (A or AAAA) Record: Right-click inside your newly created (or existing) zone in the right pane, and select "New Host (A or AAAA)..."
- Name: In the "Name" field, enter the hostname you want to map to the IP address.
- To create a record for
www.example.com
, enterwww
. - To create a record for the bare domain
example.com
(also known as a root or apex record), leave this field blank.
- To create a record for
- IP Address: In the "IP address" field, enter the IP address of the server that you want to associate with this hostname. Use an A record for IPv4 addresses and an AAAA record for IPv6 addresses.
- Create Associated PTR Record: If you want to create a reverse DNS record (PTR record) automatically, check the "Create associated pointer (PTR) record" box, provided there is a corresponding reverse lookup zone.
- Name: In the "Name" field, enter the hostname you want to map to the IP address.
-
Add Host: Click "Add Host" to create the record. Click "Done" when finished.
Example: Creating a Record for www.example.com
Let's say you want users to reach your website by typing www.example.com
in their browser, and your web server has the IP address 192.0.2.10
. Here's how you would create the forward DNS record:
- Open DNS Manager.
- Expand your server and "Forward Lookup Zones."
- Select the zone
example.com
. (Create it if it doesn't exist, as described above.) - Right-click in the right pane and choose "New Host (A or AAAA)..."
- In the "Name" field, type
www
. - In the "IP address" field, type
192.0.2.10
. - Click "Add Host."
- Click "Done."
Verification
After creating the forward DNS record, you can verify it using tools like nslookup
or dig
from a command prompt or terminal. For example:
nslookup www.example.com
The output should display the IP address you configured for the www.example.com
hostname.