1 00:00:00,340 --> 00:00:02,790 Okay, so before we talk about Route 53, 2 00:00:02,790 --> 00:00:05,840 we have to talk about what is a DNS. 3 00:00:05,840 --> 00:00:08,540 So this is a basic level lecture, 4 00:00:08,540 --> 00:00:10,990 but at least it will help you understand how DNS works. 5 00:00:10,990 --> 00:00:12,310 And this is something you've been using 6 00:00:12,310 --> 00:00:14,450 behind the scenes everyday, but you don't know 7 00:00:14,450 --> 00:00:15,350 about it exactly. 8 00:00:15,350 --> 00:00:16,580 So let's have a look. 9 00:00:16,580 --> 00:00:18,850 So a DNS is a domain name system, 10 00:00:18,850 --> 00:00:20,760 and what it will do is that it will translate 11 00:00:20,760 --> 00:00:23,810 human friendly hostnames into the target 12 00:00:23,810 --> 00:00:25,500 server IP addresses. 13 00:00:25,500 --> 00:00:27,894 For example, when you type in your web browser, 14 00:00:27,894 --> 00:00:32,530 wwww.google.com, it will in the end, give you back 15 00:00:32,530 --> 00:00:35,000 an IP address, and this is the IP address 16 00:00:35,000 --> 00:00:36,850 that your web browser will be able to access 17 00:00:36,850 --> 00:00:40,680 behind the scenes and get some data back from Google. 18 00:00:40,680 --> 00:00:42,830 So the DNS is the backbone of the internet, 19 00:00:42,830 --> 00:00:45,660 it is a way for you to understand how to translate 20 00:00:45,660 --> 00:00:49,630 these URLs, these hostnames into IPs. 21 00:00:49,630 --> 00:00:53,040 So there is a hierarchical naming structure for DNS, 22 00:00:53,040 --> 00:00:56,650 and the idea is that at the root of www.google.com, 23 00:00:56,650 --> 00:00:58,560 for example, there is the .com, 24 00:00:58,560 --> 00:01:01,700 but then there is example.com, which has a bit more precise, 25 00:01:01,700 --> 00:01:06,390 then www.example.com or api.example.com. 26 00:01:06,390 --> 00:01:09,530 So all of these are going to be the hierarchy 27 00:01:09,530 --> 00:01:10,653 of your domain names. 28 00:01:11,670 --> 00:01:13,300 Next, we need to define a little bit 29 00:01:13,300 --> 00:01:16,010 of terminology regarding your DNS. 30 00:01:16,010 --> 00:01:18,660 So there is a domain registrar, this is where you're going 31 00:01:18,660 --> 00:01:20,000 to register your domain names, 32 00:01:20,000 --> 00:01:23,580 and it could be Amazon Route 53, or it could be GoDaddy 33 00:01:23,580 --> 00:01:26,600 or any other domain registrar you can find online. 34 00:01:26,600 --> 00:01:28,640 Then you have DNS records and there are different types, 35 00:01:28,640 --> 00:01:30,830 and we'll have a look at them in detail in this section. 36 00:01:30,830 --> 00:01:33,930 So it could be A, quadruple A, CNAME, NS, 37 00:01:33,930 --> 00:01:34,763 et cetera, et cetera. 38 00:01:34,763 --> 00:01:37,580 Don't worry, we'll see those in detail in this section. 39 00:01:37,580 --> 00:01:40,220 The Zone File, which contains all the DNS records. 40 00:01:40,220 --> 00:01:42,730 So this is how to match these host names to IPs 41 00:01:42,730 --> 00:01:44,340 or addresses. 42 00:01:44,340 --> 00:01:47,030 Name Servers is servers that will actually resolve 43 00:01:47,030 --> 00:01:48,220 the DNS queries. 44 00:01:48,220 --> 00:01:50,370 And we'll have a look at them as well in the section. 45 00:01:50,370 --> 00:01:53,472 Top Level Domains, which is .com, .us, .in, 46 00:01:53,472 --> 00:01:55,610 .gov, .org, et cetera, et cetera. 47 00:01:55,610 --> 00:01:58,300 Second Level Domain, which is amazon.com, google.com. 48 00:01:58,300 --> 00:02:01,610 So you can see there are two words in between dots. 49 00:02:01,610 --> 00:02:03,150 And so if we take a look for example, 50 00:02:03,150 --> 00:02:06,740 at this FQDN, so Fully Qualified Domain Name, 51 00:02:06,740 --> 00:02:11,740 we have http://api.www.example.com. 52 00:02:13,632 --> 00:02:15,880 Okay, so the last dor at the end is called the root 53 00:02:15,880 --> 00:02:18,650 and is the root of all the domain names. 54 00:02:18,650 --> 00:02:22,510 Then the .com, so .com is your TLD. 55 00:02:22,510 --> 00:02:25,275 So that's your Top Level Domain. 56 00:02:25,275 --> 00:02:30,275 The example.com is going to be your second level domain. 57 00:02:31,110 --> 00:02:36,050 Then we have www.example.com that's your sub-domain, 58 00:02:36,050 --> 00:02:41,050 then api.www.example.com is your domain name, okay? 59 00:02:42,010 --> 00:02:45,510 The HTTP part of it is the protocol you want to use. 60 00:02:45,510 --> 00:02:48,440 And altogether we have the FQDN, 61 00:02:48,440 --> 00:02:51,230 which is the Fully Qualified Domain Name. 62 00:02:51,230 --> 00:02:53,560 So now that we know a little bit of terminology, 63 00:02:53,560 --> 00:02:56,000 let's have a look at how DNS works. 64 00:02:56,000 --> 00:02:58,800 So we have a web server, and let's say for example, 65 00:02:58,800 --> 00:03:00,810 that we have an IP, it's a public IP, 66 00:03:00,810 --> 00:03:02,740 could be an easy two instance, for example, 67 00:03:02,740 --> 00:03:06,950 and the public IP is 9.10.11.12, 68 00:03:06,950 --> 00:03:09,470 and we want to be able to access this using 69 00:03:09,470 --> 00:03:11,700 the example.com domain name. 70 00:03:11,700 --> 00:03:13,820 So we're going to register this example.com domain name 71 00:03:13,820 --> 00:03:16,670 on one our servers for the DNS. 72 00:03:16,670 --> 00:03:19,320 But let's see how the computer, your web browser 73 00:03:19,320 --> 00:03:22,090 can access it and can get that response. 74 00:03:22,090 --> 00:03:25,130 So your web browser is going to want to access example.com 75 00:03:25,130 --> 00:03:28,167 and to do so, it's going to ask its local DNS server. 76 00:03:28,167 --> 00:03:30,810 "Hey, do you know what example.com is?" 77 00:03:30,810 --> 00:03:33,180 Now this local DNS server is usually assigned 78 00:03:33,180 --> 00:03:35,430 and managed by your company or assigned 79 00:03:35,430 --> 00:03:38,260 by your internet service provider, dynamically. 80 00:03:38,260 --> 00:03:40,430 And if the local DNS server has never seen 81 00:03:40,430 --> 00:03:43,100 this query before, what it's going to do is first 82 00:03:43,100 --> 00:03:46,517 ask the root DNS server managed by the ICANN, 83 00:03:47,510 --> 00:03:49,947 the ICANN organization, and is going to say, 84 00:03:49,947 --> 00:03:52,740 "Hey, do you know what's example.com?" 85 00:03:52,740 --> 00:03:55,090 Which is the first server that's going to be asked. 86 00:03:55,090 --> 00:03:57,027 And the root DNS server is going to say, 87 00:03:57,027 --> 00:04:00,590 "I've never seen it, but I know .com." 88 00:04:00,590 --> 00:04:04,720 So .com is NS so it's an NS record, Named Server 89 00:04:04,720 --> 00:04:07,790 and go see 1, 2, 3, 4, this public IP. 90 00:04:07,790 --> 00:04:08,887 So this is saying to local DNS, 91 00:04:08,887 --> 00:04:10,200 "Hey, I don't have this answer, 92 00:04:10,200 --> 00:04:12,436 but I'm getting you a little bit closer to your answer 93 00:04:12,436 --> 00:04:15,773 because I know the .com domain and the .com domain 94 00:04:15,773 --> 00:04:19,600 name server has this IP 1, 2, 3, 4." 95 00:04:19,600 --> 00:04:20,860 So the local DNS servicing. 96 00:04:20,860 --> 00:04:24,360 Okay, good, now I'm going to ask the top level domain. 97 00:04:24,360 --> 00:04:27,490 So the .com domain server at 1, 2, 3, 4, 98 00:04:27,490 --> 00:04:30,370 I'm going to ask for the answer of my query. 99 00:04:30,370 --> 00:04:33,340 So this is another domain managed by IANA, the IANA 100 00:04:34,850 --> 00:04:38,200 and the example.com, is going to be asked again 101 00:04:38,200 --> 00:04:40,130 to this DNS server. 102 00:04:40,130 --> 00:04:42,160 So do you know about example.com? 103 00:04:42,160 --> 00:04:43,737 And the DNS server is going to say, 104 00:04:43,737 --> 00:04:45,580 "Hey, I don't know about example, 105 00:04:45,580 --> 00:04:47,205 I do know about example.com." 106 00:04:47,205 --> 00:04:49,300 "I don't know the answer to your query right away, 107 00:04:49,300 --> 00:04:50,580 I don't know which record it is, 108 00:04:50,580 --> 00:04:53,575 but there is a server called example.com that I know about, 109 00:04:53,575 --> 00:04:55,007 which is at 5.6.7.8." 110 00:04:56,657 --> 00:04:59,710 "That's a public IP that you should ask the answer 111 00:04:59,710 --> 00:05:01,520 to your question." 112 00:05:01,520 --> 00:05:03,460 So the local DNS server is then going to go 113 00:05:03,460 --> 00:05:07,350 to our final server, which is the sub-level domain 114 00:05:07,350 --> 00:05:11,030 DNS server, and this is a server that is going to be managed 115 00:05:11,030 --> 00:05:12,520 by your domain registrar. 116 00:05:12,520 --> 00:05:16,090 So it could be for example, Amazon Route 53 and so on. 117 00:05:16,090 --> 00:05:17,327 So the DNS server's gonna say, 118 00:05:17,327 --> 00:05:19,890 "Hey, do you know about example.com?" 119 00:05:19,890 --> 00:05:21,470 And the DNS server will have an entry, 120 00:05:21,470 --> 00:05:23,537 for example.com, and so it will say, 121 00:05:23,537 --> 00:05:25,740 "Hey, yes, of course, I know example.com, 122 00:05:25,740 --> 00:05:28,070 and it turns out that example.com, I know that it's 123 00:05:28,070 --> 00:05:30,900 an A record and that's the result of it 124 00:05:30,900 --> 00:05:34,610 is the IP 9.10.11.12." 125 00:05:34,610 --> 00:05:36,910 So the DNS server now knows the answer 126 00:05:36,910 --> 00:05:39,650 by recursively asking DNS servers 127 00:05:39,650 --> 00:05:41,950 and finding the most specific one. 128 00:05:41,950 --> 00:05:43,660 And then it says, "Okay, hey, yes, 129 00:05:43,660 --> 00:05:46,130 I'm going to cash that answer right away, 130 00:05:46,130 --> 00:05:49,010 because I want to be able to, if someone is asking me again, 131 00:05:49,010 --> 00:05:52,880 for example.com I want to right away give them the answer." 132 00:05:52,880 --> 00:05:56,710 So it's going to send back the answer into your web browser 133 00:05:56,710 --> 00:05:58,090 and your browser now has the answer. 134 00:05:58,090 --> 00:06:01,700 And using this IP address then is going to be able 135 00:06:01,700 --> 00:06:03,640 to access your web server. 136 00:06:03,640 --> 00:06:06,330 So this is how DNS works, so you've been using DNS 137 00:06:06,330 --> 00:06:08,260 behind the scenes, all along, all your life. 138 00:06:08,260 --> 00:06:10,770 For example, when you access www.google.com, 139 00:06:10,770 --> 00:06:12,660 you're using DNS or any websites, 140 00:06:12,660 --> 00:06:15,450 but now we see how the DNS queries work. 141 00:06:15,450 --> 00:06:16,790 So this is just some background knowledge, 142 00:06:16,790 --> 00:06:19,360 because now we're going to go into Route 53 and learn 143 00:06:19,360 --> 00:06:21,670 how to manage a DNS server on our own. 144 00:06:21,670 --> 00:06:22,503 So hope you liked it, 145 00:06:22,503 --> 00:06:24,390 and I will see you in the next lecture.