When you need to create subdomains like SD1.mysite.com
and SD2.mysite.com
in Windows Server 2008 DNS, you'll primarily work with these record types:
- A (Host) Record: Directly maps a hostname to an IP address
- CNAME (Alias) Record: Creates an alias pointing to another domain name
- Delegation: Used when you want to delegate control of a subdomain to another DNS server
For your specific case of pointing to localhost port 81, you'll want to create A records pointing to 127.0.0.1. Here's why:
SD1.mysite.com. IN A 127.0.0.1
SD2.mysite.com. IN A 127.0.0.1
The web server configuration (IIS/Apache) will handle the port 81 part, not DNS.
In Windows Server 2008 DNS Manager:
- Right-click your zone (
mysite.com
) - Select New Host (A or AAAA)
- Enter the subdomain name (
SD1
) - Enter the IP address (
127.0.0.1
) - Check "Create associated pointer (PTR) record" if reverse lookup is needed
After creating the records, verify them using these commands:
nslookup SD1.mysite.com
ping SD1.mysite.com
If you later need to point subdomains to different servers:
SD1.mysite.com. IN A 192.168.1.10
SD2.mysite.com. IN A 192.168.1.11
Remember that DNS changes may take time to propagate (TTL-dependent).
- Forgetting the trailing dot in manual entries (indicates FQDN)
- Not checking for duplicate records
- Mixing A records and CNAMEs incorrectly
When working with Windows Server 2008 DNS management, you'll typically see a hierarchical structure representing your domain (e.g., mysite.com). To create subdomains like SD1.mysite.com and SD2.mysite.com, you need to understand the different record types available.
For most subdomain scenarios where you want to point to localhost on port 81, you'll typically use either:
- A records - Direct mapping to IP addresses
- CNAME records - Aliases pointing to other names
Here's how to create a subdomain record in Windows Server 2008 DNS Manager:
- Open DNS Manager (dnsmgmt.msc)
- Expand your server and the Forward Lookup Zones
- Right-click your domain (mysite.com)
- Select "New Host (A or AAAA)..."
For SD1.mysite.com pointing to localhost (127.0.0.1) on port 81:
Name: SD1 IP Address: 127.0.0.1
Remember that the port (81) isn't specified in DNS - that's handled by your web server configuration.
After creating the records, verify them using nslookup:
nslookup SD1.mysite.com
You should see the correct IP address returned.
If you want SD2.mysite.com to point to an existing hostname:
Right-click domain → New Alias (CNAME) Alias name: SD2 Fully qualified domain name: existing-server.mysite.com
- Forgetting to allow time for DNS propagation
- Not configuring the web server to listen on the subdomain
- Mixing up A records and CNAME records
For bulk operations, you can use PowerShell:
Add-DnsServerResourceRecordA -Name "SD1" -ZoneName "mysite.com" -IPv4Address "127.0.0.1" Add-DnsServerResourceRecordCName -Name "SD2" -ZoneName "mysite.com" -HostNameAlias "existing-server.mysite.com"