What is DNS? - Introduction to Domain Name System

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so first what is DNS and under five minutes so let's say that you've launched your first web server and you want to serve a website using this server your server that's connected to the Internet will have an IP address let's say it's 1.2.3.4 the IP address is what is used for any type of client whether it's a you know humans laptops web browser or another server somewhere on the Internet it's going to use the IP address to actually connect and talk to this web server however humans don't really like numbers they prefer names easier to memorize easier to type in and so let's say that you want to serve a website that has a human readable address let's call it WWE example.com well you need something to translate WWE example comm into an IP address so that the browser or other client in the connectivist that's where dns comes into the picture so let's say that you're hosting your website your web server in AWS have gotten ec2 instance and it's got an IP address now you have a user with a computer and they want to go to WWE sample comm it needs to be some type of look up here so enter DNS DNS is basically a phonebook for the internet it changes names into IP addresses so computers can talk to each other DNS isn't just one server it's not just one system it's actually a very large distributed system a server is all across the internet belonging to different entities they all talk to each other and there's no single source of truth all of this lookup information this phonebook is actually a very distributed system and any one server any one piece of the DNS system only knows a little piece it only knows kind of what it's responsible for and then it knows pointers to other parts of the system which are responsible for other bits so this domain name is actually gonna get broken up into pieces and you'll see how different parts of that domain name are known about by different parts of the DNS system so first you're the client is going to talk to a DNS server nearby a special server called a resolver and that resolver is typically run by that users internet service so when you sign up for any internet service automatically you'll be configured to use the nearest resolver and the resolvers job is to take queries so for example where is example.com and translated that into answers and the resolver does all the legwork of looking up different parts of that name to get a complete answer and then returns that to the client so the first part the first thing it does is ask the root name server the root name server is actually a set of name servers only know about the the last part of that domain name so ComNet org dot uk' and so on and it will return a pointer to the next part of the chain so the root name server will get asked where as wwm will calm and it will reply i don't know about WWE sample com but I do know about dot-com that's my job and so what it returns is a reference to another name server and this other name server then goes about com so the resolver takes that bit of information and then asks the same question to the name server for dot-com where is wwe.com the name server for com doesn't know about WWE comm but it does know about example.com so what returns a response saying I know who knows about what you're looking for it's actually route 53 so go ask route 53 who is the name server for example.com okay wait a second how does the name server for com know that route 53 is the DNS provider for example.com well actually if you register that domain name you told com about your DNS provider it may have happened without you knowing about it but when you register a domain name one of the most important things your registrar does is update that name server for the top-level domain so calm if it's a.com domain name with information about who your DNS provider is you can change that information if you want to switch DNS providers at some point so now the dns resolver has information about route 53 knowing about this domain name so it asks the same questions rep 53 is where as a WWE ml comm route 53 actually knows it gives back an IP address since www.example.com is that the following IP address now how does route 53 know well when you chosen route 53 as your DNS provider you create something inside of route 53 a resource called a hosted zone a hosted zone is like it containers for all of the individual records or entries for things in that domain name www.example.com bar.example.com and so on and you create these individual DNS records inside that hosted zone something other resolver has a complete answer says back to the client and says here's the IP address the client then uses that IP address to connect over HTTP or whatever appropriate protocol to your server and you have a successful web transaction now all of this happens behind the scenes for basically any type of website lookup we're any client to server communication across the internet just generally a DNS lookup followed by the actual connection to the server that you want to talk to this all happens generally without the users knowledge web browser in this case is what's doing all of this these transactions okay so that's DNS in the nutshell you can run your own DNS server many people our customers do it however a managed service like route 53 provides several key advantages first route 53 doesn't just run out of one location or one server we have an anycast network which means that we have over 50 locations around the world generally going to be some very close to your end-users which provide a high degree of redundancy and also provides higher performance because of those DNS queries don't have to go halfway around the world to be answered they'll be answered by a location that's quite close to your end-user because we have redundant locations as well as many other layers of redundancy we're able to provide a hundred percent SLA on returning answers to DNS queries which is obviously very important because you need that DNS lookup to succeed in order for someone to reach your website you can also do some advanced routing using Dee for example based on the end-users location you can give them a different IP address so you can route an end-user to a location if you're running in multiple regions you could Rob that user to a region that's closest to them for example you can also have rap 53 monitor each of your locations through each of your servers and if one of those servers were to go down or become unreachable Roth 53 can automatically respond by giving up a different IP address of a backup location so you can route your users around failed locations route 53 provides some integrations with AWS services that makes it easier to route traffic to things like elastic load balancing CloudFront distribution that's through a website elastic beanstalk environments as well we'll talk about that later and lastly it's easy to manage you can use the web console but there's also full support of managing anything interrupt 43 via the API command-line tools SDKs as well as a robust set of third-party tools so now let's look at the steps involved in creating and setting up DNS for your first website or web application so here's a diagram we're gonna do four steps first you need a domain name so we'll register a domain name next and roughly freeze DNS interface you're going to create something called a hosted zone in that hosted zone you're going to create several DNS records that will point traffic to specific IP addresses or specific resources in AWS and then lastly we'll connect the domain name to the hosted zone this is a very important step called delegation where you basically update your registrar with the correct name servers for your route 53 hosted zone this is what connects everything it makes everything work the first step gonna be registering a domain name now route 53 actually provides that the main name registrar within the roughly three console and API so you can register a new domain names directly and run 53 we'll show a brief overview of how to do that you can also register a domain name somewhere else there's many well-known registrar's that you use and you can then connect those throughout 53 will show both techniques so first this is the route 53 management console you log in go to route 53 and one of the things you see right there on the front page is a search box just like at any other registrar where you can search for domain names so here we'll search for example.com obviously the real in the real world example com is taken but for the sake of this presentation we'll assume that it's available so we'll buy the domain name example.com and to your shopping cart you can register for multiple years at the ten years will also automatically renew enter your contact information for the registration you can hide most of your contact details for most top-level domains which helps eliminate spam against your contact info and you complete the purchase and then we're done when you've registered a new domain name in route 53 will automatically create the matching hosted zone for you and do that delegation piece so you don't have to worry about okay however if you register a domain name through an existing or other registrar or let's say you already own a domain name through some other registrar you're going to have to eventually update some information at the other registrar specifically that's something called named service so if you've already registered a domain name with a different registrar you're not yet using route 53 chances are that you're getting free DNS service from that registrar so here you'll see this is just other registrar's web console you'll see some listings under name servers we'll come back to this in a bit and we're going to actually update this section with your route 53 name service so that's domain name registration either through 53 or through another registrar now let's create the hosted zone again if you've already registered domain name in route 53 we've created this whole zone for you however you like you to create one a few registered to a different register so well look at the hosted zone you go to the HOSA zones tab and rows 53 see example.com listed you click on the name and now we're in the hosted zone you see that there's already two DNS records created in this houses own for you automatically these are the default records in every host ism the one that we're most concerned about is the top one of type NS or name server and you'll see that there's four entries here these four entries are the four specific name servers for this hosted Zone in route 53 now every host is owned by default gets a unique set of these four name servers so it is very important when you're using route 53 to enter these exact values for whatever host is on you have at your registrar so now let's assume that we've registered the domain name through route 53 as well go to your registered domains tab you'll see your domain name you look through them and you see now some name servers listed for your domain name since you registered this domain name in route 53 we've already connected everything for you and so those name server names match exactly this is what you want this means that route 53 is DNS service will be serving DNS traffic for this domain name now if you've registered the domain name through a different registrar you're going to need to create a House's own so you go to the hostess owns tab click create hosted zone enter the domain name this has to obviously exactly match the domain name that you own you can create a comment if you want and then you're going to leave the type drop-down to its default setting of public hosted zone so now you'll see some records in this hosting zone again the NS record is the one that is most important to look at for now you'll see for name servers listed again these are going to be unique to this hosted zone now that we're in your route 53 Hustons though we're going to create some records that actually direct traffic to your web server now you can create records for your domain name itself so example.com we call that the root domain as well as names inside or sort of children of that domain so for example you can create www calm my site at example.com food bar.example.com and so on these are called subdomains lastly you can create records that match any other name that someone might enter into their web browser that would be a subdomain that you don't have an explicit record for so these are called wildcard records okay so we'll create all of these and show show what that looks like okay so looking at your hosted zone you click create records set now you're presented with a dialog that gives you a couple options here the first is the name field now we're going to create a record for example.com first so we've already filled in the example.com part because that's your hosted zone so you don't actually need to type anything into that text box at the top down below in the value field you're going to enter the IP address of your web server and click create and now you see the record listed now let's create the same thing for wwx ample com so here in the name field you're going to enter your subdomain which is ww and the value you can enter the same IP address or going to a different web server you could enter a different IP address if you want multiple domain names or subdomains to be served by the same ip address there's actually several other options you can use here we'll talk about those in a minute where you don't have to enter the same IP address over and over again so we'll do that we'll take one of these other options something called a cname we're going to create our wildcard record so the symbol for wildcard is a star or asterisk so we'll create the record start an example comm and the type we're going to change that for the default we're going to select something called a cname a cname means you're not going to give an IP address instead you're going to give another name another DNS name and when that DNS lookup happens the user is ultimately going to get the IP address belonging to that other name so here we're going to enter as the value for the cname record example.com what this means is that when a user makes a query for something that's answered by this record they're going to get the IP address back for example.com click Save and now we have three records created in our host and sown in addition to the default two there's another option that's important to think about for route 53 which is if you are creating a domain name or DNS name that you want to point to something like an elastic load balancing load balancer elastic beanstalk environment s3 website bucket or CloudFront distribution all of those things have IP addresses that can change and so you don't want to hard-code the IP address for those resources also you can't create a cname at the root domain so for example com that name itself can't have a cname record having a cname record at that point in your host as though it actually breaks DNS lookups and so it's not allowed instead there's a feature called alias alias tells her out 53 to go fetch the current IP address for whatever resource you've aliased to and give that back as a response so what we're going to do here is create an alias record and you can create that alias record and point that to your elastic load balancer or any of those other resources I've mentioned route 53 will always fetch in real time the correct set of IP addresses for those resources so to create an alias record you're going to select the radio button for alias and you'll be presented with a drop-down list where you can select all of your resources and you can select which resource you want alias to you can also then alias to other DNS records in that same host as own if you want okay so again the services that route 53 currently integrates with for alias functionality are the following for the last cue cloud from s3 website there is another consideration here which is that you need to configure your resources in those services to look for that same domain name in other words the cloud from distribution you need to create something called an alternate domain name that exactly matches your domain name and the s3 website bucket if you're going to use that the s3 bucket name actually also has to exactly match the DNS name so if I want to create an s3 website bucket for WWE comm when I create the s3 web site bucket I have to call that bucket ww example comm other types of records that you'll likely want to create in your host is own it would be for example an MX record an MX record is for email if you want to receive email at this domain name your email service provider will give you all the information you need to create that MX record M X stands for mail exchanger txt is text record you can store arbitrary bits of text in those records typically used for things like validating that you have are that you're the authorized sender for email from that domain name also used for setting up web analytics in many cases for your website it's also a common way for vendors of SSL Certificates to verify that you actually own that domain name I'll give you a text string tell you to create the following text record in that hosted zone when you create that then your certificate vendor will know that you actually only control that domain name so now we've created your hosting zone but all the records in there that you need next step is to delegate which means to connect your domain name to route 53 so that route 53 starts serving DNS traffic for that domain now if you've used route 53 as a registrar we've already done that for you we've already created the hosted zone and domain name and delegated between them again the name server addresses are going to be listed for your host zone in that NS record in your host is up the four name servers the term for that that set of four is called delegation set again that delegation set is going to be unique to you as a customer no other customers HOSA zone will share that same set of four name service this carries some benefits for example a something there were to be some type of issue with another customers hosted zone you are isolated from that because you have who will have at least two in many cases three or three or four different themes and four addresses from that affected customers so every customer is isolated across name server addresses also makes it very important that you copy and paste the exact name server names for your hosted zone so now again this is the graph your three registrar interface will already populate this for you in the name server section with you servus if you're with a different registrar you're going to go to that other registrar's web console go to the name service section and replace what's already in there with your delegation set your for ruff get your name service and now you're done you've made all the entries that you need to do for reps you free to start serving traffic through their website however this if you're already using a different DNS provider that change can take up to two days 48 hours to become fully effective and the reason is that these name server entries are cached or saved for periods of time across the DNS network around the world and those are typically cached with time to live of 48 hours which means that lead to expire before route 53 is fully serving all of your traffic so to recap we've done four things we've got a domain name created a hosted zone created records in the Xhosa zone and then we've delegated to it now there are some tools that you can use to verify that you've got everything set up correctly the most popular tools are dig in the Linux environment and nslookup in the Windows environment we'll look at dig here nslookup functions in a very similar way so here we have our Linux prompt or get type dig example.com and this is the response you get back so there's a lot of information here the thing we're looking for is in the answer section that example.com was answered with an a record and with the following IP address so we see that we were able to get an IP address back for example.com another useful query to do via this dig tool is to make sure that you have the right name servers configured so here you do dig in the s uppercase example.com and here we're not getting back an IP address we're getting a list of the name servers active for example.com here you can see the rough into three name servers shown another useful option is to skip all of the cached or saved DNS responses and make a query directly to each of those name servers that we showed in that diagram starting with the root name server then the name server for your top-level domain and then route 53 and so on you do this by doing dig than the domain name and then with the option plus trace the response is going to be very verbose it's going to scroll off your screen but we've condemned condensed it a bit here to show of each of the different queries that happened first was a query against your root name server that's the top row that gave back in answer for com query against that name so everything gave back an example or the response for example.com and finally the query against route 53 gave back the IP address which is
Info
Channel: Amazon Web Services
Views: 106,742
Rating: undefined out of 5
Keywords: AWS, Amazon Web Services, Cloud, cloud computing, AWS Cloud, DNS, Amazon Route 53, Domain Name System, re:Invent 2016
Id: e2xLV7pCOLI
Channel Id: undefined
Length: 22min 26sec (1346 seconds)
Published: Wed Dec 14 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.