Now that we are familiar with moving around a little bit inside the DNS management tool, we are going to create and test another type of record. This one is called a CNAME, and it is easiest to think of this one as an alias record. Rather than taking a DNS name and pointing it at an IP address, as we do with a host record, with a CNAME, we are going to take a DNS name and point it at another DNS name! Why would this be necessary? If you are hosting multiple services on a single server but want those services to be contacted by using different names, CNAME records can be your best friend.
We are going to make use of the same environment that we used to create our A records in the Creating an A or AAAA record in DNS recipe. There is a DC/DNS server online where we are going to create our records. Also running is WEB1, a server where we are hosting a website as well as some file shares. We will also use a Windows 10 client to test out our CNAME records after they have been created.
To create and test a CNAME record, perform the following instructions:
http://intranet
. So in our CNAME record, we want the Alias name to be INTRANET
and the FQDN for target host to be WEB1.MYDOMAIN.LOCAL
, which is the server where the website is being hosted.
\FILESERVERSHARE
, so that the actual name of the server hosting this share is not visible to the users. Create another CNAME record with the Alias name field as FILESERVER
, and the FQDN for target host field as WEB1.MYDOMAIN.LOCAL
.http://intranet
. They are also able to open File Explorer and access \fileservershare
.We have a server in our environment called WEB1. There is a website running on this server. It is also hosting a file share called SHARE. By creating a couple of quick CNAME records inside DNS, we are able to give users the ability to use some intuitive names to access these resources. By following the preceding instructions, we have masked the actual server name from the users, making knowledge of that name unnecessary. Masking internal hostnames of servers is also considered a security best practice in many organizations.
18.216.24.36