When you enter a URL into a web browser, the URL has three main parts to it.
A top-level domain, the domain name, and the subdomain.
A DNS server is able to resolve the words used to identify the host into the IP address for that specific server.
For a company, you will typically have a single domain name, like dougwinnie.com, but you may have multiple subdomains.
Subdomains can do a few things: One thing they can do is link to specific web servers.
For instance, www.dougwinnie.com is pointing to a specific web server.
That subdomain, www, defines a very specific IP address for that server.
I can have multiple subdomains, like dev, prod, or beta.
All of which are pointing to different IP addresses.
Subdomains can also be very misleading.
That's because the information that is stored about them in a DNS may redirect to completely different servers.
In a DNS there are records, called A records and CNAME records.
They store rules for how domains are translated to IP addresses.
Let's say in our DNS we have a record for dev.example.com This is a web server name that we want to resolve to 123.45.67.89 For that URL to translate to the IP address, we need to have that record be in the DNS server to begin propagating that throughout the internet.
We can do that by adding a record to our DNS.
Typically, if you are working with a company to host your website, you can update the records for your sites.
On the DNS is a record called an A record, or address record.
This is the IP address that we want to map to the full URL.
So when the DNS is asked for the IP address for dev.example.com, the server looks for the matching address record, and returns the IP address.
But let's say we have a second URL for test.example.com.
This might be a URL that doesn't have a unique server associated with it, but we want to use to redirect to another URL.
In that case, we want to create a CNAME record, or canonical name record.
On the same DNS, a CNAME record can be added.
This lists the name that is requested, and then what URL name that should be redirected to.
So in this example, test.example.com is redirected to dev.example.com and then is then resolved to the address 123.45.67.89 The records that are in the DNS help browsers, networks be able to identify a server using the URL.
With the use of the A and CNAME records in a DNS, IP mappings can be created to resolve URLs to their specific server IP addresses.








Comments
Post a Comment