1
1

00:00:00,230  -->  00:00:03,450
<v ->DNS, Domain Name System.</v>
2

2

00:00:03,450  -->  00:00:05,230
In this lesson, we're going to talk about
3

3

00:00:05,230  -->  00:00:08,020
the Domain Name System, or DNS.
4

4

00:00:08,020  -->  00:00:10,810
The DNS protocol is used to help your network clients
5

5

00:00:10,810  -->  00:00:13,530
find a website using human-readable host names
6

6

00:00:13,530  -->  00:00:15,820
instead of numeric IP addresses.
7

7

00:00:15,820  -->  00:00:18,470
For example, if I told you to visit my website,
8

8

00:00:18,470  -->  00:00:21,860
I can simply say, "Hey, go over to diontraining.com,"
9

9

00:00:21,860  -->  00:00:24,010
and that's a lot easier for you to remember
10

10

00:00:24,010  -->  00:00:29,010
than having to remember it's 66.123.45.237,
11

11

00:00:29,380  -->  00:00:32,790
or whatever the IP address of my web server happens to be.
12

12

00:00:32,790  -->  00:00:35,110
After all, saying all those numbers
13

13

00:00:35,110  -->  00:00:36,640
as part of a TV commercial,
14

14

00:00:36,640  -->  00:00:38,440
isn't quite as catchy or memorable
15

15

00:00:38,440  -->  00:00:40,980
as telling your consumer to visit diontraining.com,
16

16

00:00:40,980  -->  00:00:44,860
or coca-cola.com or microsoft.com, right?
17

17

00:00:44,860  -->  00:00:46,800
So, how does the computer know how to find
18

18

00:00:46,800  -->  00:00:48,380
the web server's IP address
19

19

00:00:48,380  -->  00:00:50,320
from these different domain names?
20

20

00:00:50,320  -->  00:00:54,820
Well, that's the purpose of DNS, the Domain Name System.
21

21

00:00:54,820  -->  00:00:57,620
The way DNS works is that the user's computer
22

22

00:00:57,620  -->  00:01:00,780
gets told to go to someplace like diontraining.com.
23

23

00:01:00,780  -->  00:01:02,917
And so, it reaches out to a DNS server and says,
24

24

00:01:02,917  -->  00:01:05,680
"Hey, who is diontraining.com?"
25

25

00:01:05,680  -->  00:01:07,807
And the DNS server is going to then reply back and say,
26

26

00:01:07,807  -->  00:01:10,250
"Oh, I know diontraining.com.
27

27

00:01:10,250  -->  00:01:13,030
Its IP addresses is 66 dot something,
28

28

00:01:13,030  -->  00:01:14,730
dot something, dot something."
29

29

00:01:14,730  -->  00:01:17,610
Then, the client gets redirected to a web server
30

30

00:01:17,610  -->  00:01:20,490
using their router, and their way in connection
31

31

00:01:20,490  -->  00:01:22,290
since they now know the right IP address
32

32

00:01:22,290  -->  00:01:23,920
to use as their destination.
33

33

00:01:23,920  -->  00:01:25,730
And all this happens in the background
34

34

00:01:25,730  -->  00:01:27,480
for your users and your computer,
35

35

00:01:27,480  -->  00:01:29,840
without anyone having to actually ask for it,
36

36

00:01:29,840  -->  00:01:31,940
because DNS is such an embedded part
37

37

00:01:31,940  -->  00:01:33,770
of our networks and systems.
38

38

00:01:33,770  -->  00:01:35,760
Now, most of us as home users,
39

39

00:01:35,760  -->  00:01:37,960
won't be running our own DNS servers,
40

40

00:01:37,960  -->  00:01:40,490
but instead, we rely on our internet service providers
41

41

00:01:40,490  -->  00:01:41,930
to do this for us.
42

42

00:01:41,930  -->  00:01:43,710
But if you're running your own websites
43

43

00:01:43,710  -->  00:01:45,420
or a large corporate network,
44

44

00:01:45,420  -->  00:01:48,750
you might also have your own DNS server inside your network
45

45

00:01:48,750  -->  00:01:50,260
and you'll be responsible for setting up
46

46

00:01:50,260  -->  00:01:53,300
your own DNS records that dictate what servers are located
47

47

00:01:53,300  -->  00:01:56,710
at what IP addresses and for what purposes.
48

48

00:01:56,710  -->  00:01:58,720
This allows you to run your own domain name
49

49

00:01:58,720  -->  00:01:59,990
and host resolution,
50

50

00:01:59,990  -->  00:02:03,230
which will convert those domain names to IP addresses.
51

51

00:02:03,230  -->  00:02:04,500
If you want to think of it like this,
52

52

00:02:04,500  -->  00:02:07,550
it's similar to having a contact list on your phone.
53

53

00:02:07,550  -->  00:02:10,470
Nowadays, how many phone numbers do you have memorized?
54

54

00:02:10,470  -->  00:02:12,230
Probably not a whole lot of 'em, right?
55

55

00:02:12,230  -->  00:02:14,610
Because normally you're going to pull out your smartphone,
56

56

00:02:14,610  -->  00:02:16,880
scroll to the person's name and hit their name
57

57

00:02:16,880  -->  00:02:19,470
with your finger and then the phone dials them up.
58

58

00:02:19,470  -->  00:02:22,590
For example, if I want to call my wife, I scroll to her name,
59

59

00:02:22,590  -->  00:02:24,600
I push a picture of her face on my phone
60

60

00:02:24,600  -->  00:02:27,710
and then immediately my phone dials her number.
61

61

00:02:27,710  -->  00:02:30,500
I don't have to memorize all 10 digits of her phone number
62

62

00:02:30,500  -->  00:02:32,510
because my phone does it for me.
63

63

00:02:32,510  -->  00:02:34,160
That's because as people,
64

64

00:02:34,160  -->  00:02:37,270
we have a harder time remembering numbers than we do names.
65

65

00:02:37,270  -->  00:02:39,380
And so we do this face or name
66

66

00:02:39,380  -->  00:02:42,110
to number conversion using our contact list.
67

67

00:02:42,110  -->  00:02:43,890
It's the same thing for computers
68

68

00:02:43,890  -->  00:02:46,330
except computers actually like numbers
69

69

00:02:46,330  -->  00:02:47,860
a lot better than names.
70

70

00:02:47,860  -->  00:02:49,940
So we want to convert the domain names
71

71

00:02:49,940  -->  00:02:52,520
that are easier for us into IP addresses
72

72

00:02:52,520  -->  00:02:55,310
that are easier for computers to do their routing with.
73

73

00:02:55,310  -->  00:02:57,440
And that's all DNS really does for us.
74

74

00:02:57,440  -->  00:03:00,640
It converts names to numbers and numbers to names.
75

75

00:03:00,640  -->  00:03:03,350
Now, one of the concepts with DNS that we need to talk about
76

76

00:03:03,350  -->  00:03:07,710
is what's known as a fully qualified domain name or FQDN.
77

77

00:03:07,710  -->  00:03:11,140
This is when a domain name is under a top-level provider.
78

78

00:03:11,140  -->  00:03:14,780
For example, the most common top-level of provider is .com,
79

79

00:03:14,780  -->  00:03:19,300
but we also have things like .mil, .edu, .org and .net.
80

80

00:03:19,300  -->  00:03:21,480
Let's use the example of Dion Training.
81

81

00:03:21,480  -->  00:03:24,340
At Dion Training, we have lots of different servers.
82

82

00:03:24,340  -->  00:03:26,300
One of our servers is our web server
83

83

00:03:26,300  -->  00:03:28,927
and it's located at www.diontraining.com.
84

84

00:03:30,860  -->  00:03:33,770
Now the top-level domain here is .com.
85

85

00:03:33,770  -->  00:03:36,530
The domain name that I use is Dion Training.
86

86

00:03:36,530  -->  00:03:40,770
To be fully qualified, I have to add the www in front of it.
87

87

00:03:40,770  -->  00:03:45,030
This makes it www.diontraining.com.
88

88

00:03:45,030  -->  00:03:46,890
Now, if you want to go to my web server,
89

89

00:03:46,890  -->  00:03:48,680
that's what you're going to type into your browser,
90

90

00:03:48,680  -->  00:03:51,670
www.diontraining.com.
91

91

00:03:51,670  -->  00:03:54,220
And now you're going to get redirected to my web server
92

92

00:03:54,220  -->  00:03:57,250
because DNS knows how it should revolve the IP address
93

93

00:03:57,250  -->  00:04:01,030
of my web server using that fully qualified domain name.
94

94

00:04:01,030  -->  00:04:03,410
Now, if you wanted to go to my file server instead,
95

95

00:04:03,410  -->  00:04:06,780
you're going to have to type in ftp.diontraining.com
96

96

00:04:06,780  -->  00:04:08,950
because that's the server I'm running there.
97

97

00:04:08,950  -->  00:04:10,400
If you want to go to my mail server,
98

98

00:04:10,400  -->  00:04:13,250
you might type mail.diontraining.com.
99

99

00:04:13,250  -->  00:04:14,750
All three of these are examples
100

100

00:04:14,750  -->  00:04:18,020
of fully qualified domain names or FQDNs.
101

101

00:04:18,020  -->  00:04:20,910
Essentially there's a service, a dot,
102

102

00:04:20,910  -->  00:04:24,330
a domain name, a dot, and a top-level domain.
103

103

00:04:24,330  -->  00:04:25,610
And this works the same way,
104

104

00:04:25,610  -->  00:04:27,140
no matter which domain you're looking at
105

105

00:04:27,140  -->  00:04:28,790
across the internet.
106

106

00:04:28,790  -->  00:04:31,940
Now, DNS is going to be set up as a hierarchy.
107

107

00:04:31,940  -->  00:04:34,180
This occurs at five different levels.
108

108

00:04:34,180  -->  00:04:36,860
We have the root level, the top-level domain,
109

109

00:04:36,860  -->  00:04:40,390
the second-level domains, subdomains, and the host.
110

110

00:04:40,390  -->  00:04:42,170
The root level is the highest level
111

111

00:04:42,170  -->  00:04:43,820
in the DNS hierarchy tree.
112

112

00:04:43,820  -->  00:04:46,050
And the root name server is going to answer requests
113

113

00:04:46,050  -->  00:04:47,640
in the root zone.
114

114

00:04:47,640  -->  00:04:49,450
These servers contain the global list
115

115

00:04:49,450  -->  00:04:53,797
of all the top-level domains, things like .com, .net,
116

116

00:04:53,797  -->  00:04:56,300
.org, .mil and others.
117

117

00:04:56,300  -->  00:04:59,800
The second level down is going to be the top-level domains.
118

118

00:04:59,800  -->  00:05:02,200
These are broken up into two categories,
119

119

00:05:02,200  -->  00:05:05,927
organizational hierarchies, such as .com, .net,
120

120

00:05:05,927  -->  00:05:09,100
.org and others, and then the geographical hierarchy
121

121

00:05:09,100  -->  00:05:13,477
such as .uk for the United kingdom, .fr for France,
122

122

00:05:13,477  -->  00:05:16,730
.it for Italy and other countries like that.
123

123

00:05:16,730  -->  00:05:19,820
The third level down is known as second-level domains.
124

124

00:05:19,820  -->  00:05:23,260
These domains sit directly below the top-level domain.
125

125

00:05:23,260  -->  00:05:26,050
For example, my domain, Dion Training
126

126

00:05:26,050  -->  00:05:30,600
is a second-level domain under the .com top-level domain.
127

127

00:05:30,600  -->  00:05:34,010
The .com sits underneath the root domain.
128

128

00:05:34,010  -->  00:05:36,400
This is the way these things level up together
129

129

00:05:36,400  -->  00:05:38,080
as part of the hierarchy.
130

130

00:05:38,080  -->  00:05:40,930
The fourth level down is known as the subdomain.
131

131

00:05:40,930  -->  00:05:42,840
So if I wanted to create a new server
132

132

00:05:42,840  -->  00:05:46,260
underneath my second level domain of diontraining.com,
133

133

00:05:46,260  -->  00:05:48,430
I can do that using a subdomain.
134

134

00:05:48,430  -->  00:05:50,720
In my case, I have a lot of different subdomains
135

135

00:05:50,720  -->  00:05:51,990
for different purposes.
136

136

00:05:51,990  -->  00:05:55,690
I have my main website hosted at the www subdomain.
137

137

00:05:55,690  -->  00:05:59,140
So you type in www.diontraining.com
138

138

00:05:59,140  -->  00:06:00,960
and that takes you to my web server,
139

139

00:06:00,960  -->  00:06:03,010
but I also have one called support.
140

140

00:06:03,010  -->  00:06:04,860
Now, the support subdomain is located
141

141

00:06:04,860  -->  00:06:06,260
at support.diontraining.com.
142

142

00:06:07,440  -->  00:06:10,700
I have another one for mail, mail.diontraining.com.
143

143

00:06:10,700  -->  00:06:12,760
These are all different subdomains.
144

144

00:06:12,760  -->  00:06:15,840
Now, the fifth and final level down is the host level.
145

145

00:06:15,840  -->  00:06:17,860
This is the lowest and the most detailed level
146

146

00:06:17,860  -->  00:06:21,390
inside of the DNS hierarchy and refers to a specific machine
147

147

00:06:21,390  -->  00:06:23,370
or server on the network.
148

148

00:06:23,370  -->  00:06:25,000
Now, when we think of DNS, though,
149

149

00:06:25,000  -->  00:06:26,740
most of us are just going to think of something
150

150

00:06:26,740  -->  00:06:28,700
like a fully qualified domain name,
151

151

00:06:28,700  -->  00:06:31,810
something like www.diontraining.com,
152

152

00:06:31,810  -->  00:06:33,170
which contains a subdomain,
153

153

00:06:33,170  -->  00:06:36,050
a second-level domain, and a top-level domain.
154

154

00:06:36,050  -->  00:06:38,060
Now, if I wanted to take it a step further,
155

155

00:06:38,060  -->  00:06:40,300
I can look at it from a URL perspective,
156

156

00:06:40,300  -->  00:06:43,240
which is known as a Uniform Resource Locator.
157

157

00:06:43,240  -->  00:06:46,070
Again, let's take my web server as our example here,
158

158

00:06:46,070  -->  00:06:48,630
www.diontraining.com.
159

159

00:06:48,630  -->  00:06:50,770
That's my fully qualified domain name,
160

160

00:06:50,770  -->  00:06:53,580
but it doesn't tell you how to access it.
161

161

00:06:53,580  -->  00:06:56,210
Do you want to do this securely or insecurely?
162

162

00:06:56,210  -->  00:06:59,740
Well, you're going to have to tell that by doing the URL.
163

163

00:06:59,740  -->  00:07:02,070
Well, if you want to give me your username and password,
164

164

00:07:02,070  -->  00:07:03,810
you should do this securely.
165

165

00:07:03,810  -->  00:07:07,780
So you're going to add the HTTPS colon slash slash
166

166

00:07:07,780  -->  00:07:11,020
in front of www.diontraining.com.
167

167

00:07:11,020  -->  00:07:14,740
And that becomes a URL, a Uniform Resource Locator,
168

168

00:07:14,740  -->  00:07:16,600
because it tells you how to access
169

169

00:07:16,600  -->  00:07:19,320
diontraining.com's web server.
170

170

00:07:19,320  -->  00:07:22,300
That's why we have that HTTPS at the beginning.
171

171

00:07:22,300  -->  00:07:25,140
It is the Hypertext Transfer Protocol Secure,
172

172

00:07:25,140  -->  00:07:27,290
and that's the method of accessing it.
173

173

00:07:27,290  -->  00:07:28,770
Now, if you wanted to access my website
174

174

00:07:28,770  -->  00:07:30,080
and do it insecurely,
175

175

00:07:30,080  -->  00:07:33,740
you could do that by adding HTTP colon slash slash
176

176

00:07:33,740  -->  00:07:35,520
to be the beginning of the web address.
177

177

00:07:35,520  -->  00:07:37,450
Now, if you want to connect using FTP,
178

178

00:07:37,450  -->  00:07:40,160
you would use FTP colon slash slash,
179

179

00:07:40,160  -->  00:07:43,360
ftp.diontraining.com as your URL.
180

180

00:07:43,360  -->  00:07:45,120
And so there's lots of different ways to do this
181

181

00:07:45,120  -->  00:07:46,960
as you tell the system what to do.
182

182

00:07:46,960  -->  00:07:48,580
And that's the difference between a URL
183

183

00:07:48,580  -->  00:07:50,770
and a fully qualified domain name.
184

184

00:07:50,770  -->  00:07:52,590
Next, we need to talk about the different types
185

185

00:07:52,590  -->  00:07:56,190
of DNS records that exist within a DNS server.
186

186

00:07:56,190  -->  00:07:57,640
Inside your DNS server,
187

187

00:07:57,640  -->  00:07:59,220
you're going to create different records
188

188

00:07:59,220  -->  00:08:01,290
that hold different types of information
189

189

00:08:01,290  -->  00:08:02,870
based on your use case.
190

190

00:08:02,870  -->  00:08:04,717
These are known as A records,
191

191

00:08:04,717  -->  00:08:07,590
AAAA records, CNAME records,
192

192

00:08:07,590  -->  00:08:12,590
MX records, SOA records, PTR records, TXT records,
193

193

00:08:12,900  -->  00:08:15,310
SRV records, and NS records.
194

194

00:08:15,310  -->  00:08:16,410
Let's take a quick look
195

195

00:08:16,410  -->  00:08:18,400
at each of these different record types.
196

196

00:08:18,400  -->  00:08:19,970
First, we have an A record
197

197

00:08:19,970  -->  00:08:22,000
which stands for an Address record,
198

198

00:08:22,000  -->  00:08:24,416
and A record is used to link a host name
199

199

00:08:24,416  -->  00:08:26,150
to an IPv4 address.
200

200

00:08:26,150  -->  00:08:30,720
For example, there's an A record for www.diontraining.com
201

201

00:08:30,720  -->  00:08:34,250
and it links it to the IP address of 45.79.184.180.
202

202

00:08:37,510  -->  00:08:39,180
In addition to this, you may also set
203

203

00:08:39,180  -->  00:08:41,080
an A record for the at host
204

204

00:08:41,080  -->  00:08:43,710
and this indicates a record for the root domain.
205

205

00:08:43,710  -->  00:08:45,180
In the example of Dion Training
206

206

00:08:45,180  -->  00:08:48,220
are at record signifies the diontraining.com,
207

207

00:08:48,220  -->  00:08:50,780
which is the root of our domain is going to be listed
208

208

00:08:50,780  -->  00:08:52,300
at a certain IP.
209

209

00:08:52,300  -->  00:08:54,380
This way, our users can find our website
210

210

00:08:54,380  -->  00:08:57,950
by going the subdomain of www.diontraining.com
211

211

00:08:57,950  -->  00:09:00,840
or just by going to diontraining.com
212

212

00:09:00,840  -->  00:09:03,610
by using that A at record.
213

213

00:09:03,610  -->  00:09:06,990
Now, A records only work for IPv4 addresses,
214

214

00:09:06,990  -->  00:09:11,190
but a lot of modern websites are also supporting IPv6.
215

215

00:09:11,190  -->  00:09:13,940
To map a domain name to an IPv6 address,
216

216

00:09:13,940  -->  00:09:16,660
you're going to use an AAAA record.
217

217

00:09:16,660  -->  00:09:19,720
So using the Dion Training site as the example,
218

218

00:09:19,720  -->  00:09:24,720
I could set the AAAA record to 2400:cb00:2049:1::a29f:1804
219

219

00:09:33,180  -->  00:09:36,520
if that was the IPv6 address for my web server.
220

220

00:09:36,520  -->  00:09:39,740
As you could see, IPv6 addresses are a lot more complicated
221

221

00:09:39,740  -->  00:09:43,100
than IPv4 and really hard for us humans to memorize,
222

222

00:09:43,100  -->  00:09:46,430
which is why we like to use these AAAA records
223

223

00:09:46,430  -->  00:09:48,360
or the four A records.
224

224

00:09:48,360  -->  00:09:50,010
The next type of record we can use
225

225

00:09:50,010  -->  00:09:53,420
is known as a CNAME record, or Canonical Name record.
226

226

00:09:53,420  -->  00:09:54,850
Now a CNAME record is used
227

227

00:09:54,850  -->  00:09:57,740
instead of an A record or an AAAA record
228

228

00:09:57,740  -->  00:10:00,140
if you want to point a domain to another domain name
229

229

00:10:00,140  -->  00:10:01,830
or a subdomain name.
230

230

00:10:01,830  -->  00:10:04,370
For example, I own a lot of different domain names
231

231

00:10:04,370  -->  00:10:06,920
out there in addition to diontraining.com.
232

232

00:10:06,920  -->  00:10:09,010
Some of these are for former companies I've had
233

233

00:10:09,010  -->  00:10:10,440
or projects I used to run,
234

234

00:10:10,440  -->  00:10:13,240
and some are ones I plan to use someday in the future.
235

235

00:10:13,240  -->  00:10:16,590
But in the meantime, I have them set with a CNAME record
236

236

00:10:16,590  -->  00:10:19,090
that resolves back to diontraining.com.
237

237

00:10:19,090  -->  00:10:21,773
For example, I used to run a website called itil4exam.com,
238

238

00:10:22,750  -->  00:10:25,360
but I've since stopped using that domain name
239

239

00:10:25,360  -->  00:10:27,220
and I've merged all those courses
240

240

00:10:27,220  -->  00:10:29,940
into my own diontraining.com website.
241

241

00:10:29,940  -->  00:10:32,210
So when I shut down that old web server,
242

242

00:10:32,210  -->  00:10:35,550
I still want to do allow people to type an itil4exam.com
243

243

00:10:35,550  -->  00:10:38,440
and reach something instead of just an error page.
244

244

00:10:38,440  -->  00:10:40,290
So I use the CNAME record
245

245

00:10:40,290  -->  00:10:42,980
to point it directly to diontraining.com.
246

246

00:10:42,980  -->  00:10:44,790
Now, why would I want to do that?
247

247

00:10:44,790  -->  00:10:46,980
Well, we were in the other site for a few years
248

248

00:10:46,980  -->  00:10:49,030
in parallel to diontraining.com
249

249

00:10:49,030  -->  00:10:51,850
and many of the links posted there are all over the internet
250

250

00:10:51,850  -->  00:10:54,180
with recommendations to our courses that were hosted
251

251

00:10:54,180  -->  00:10:56,910
on that itil4exam.com website.
252

252

00:10:56,910  -->  00:10:58,880
One of our most popular courses from that site
253

253

00:10:58,880  -->  00:11:00,750
was our ITIL 4 Foundation course,
254

254

00:11:00,750  -->  00:11:05,750
and it was located itil4exam.com/itil-4-foundation.
255

255

00:11:06,240  -->  00:11:08,460
Now, if you type that into your web browser,
256

256

00:11:08,460  -->  00:11:11,260
it will resolve the itil4exam.com part
257

257

00:11:11,260  -->  00:11:13,920
to diontraining.com and take you directly
258

258

00:11:13,920  -->  00:11:18,330
to diontraining.com/itil-4-foundation.
259

259

00:11:18,330  -->  00:11:20,280
This means that even if you're using a link
260

260

00:11:20,280  -->  00:11:22,290
that you found on Reddit that recommended our course
261

261

00:11:22,290  -->  00:11:24,570
from a few years ago, it's still going to work
262

262

00:11:24,570  -->  00:11:26,430
and take you to our sales page,
263

263

00:11:26,430  -->  00:11:29,180
even though the original itil4exam.com server
264

264

00:11:29,180  -->  00:11:32,750
no longer is even in service and has been taken offline.
265

265

00:11:32,750  -->  00:11:35,040
Another use case for using a CNAME record
266

266

00:11:35,040  -->  00:11:37,430
is when you're using a software as a service offering
267

267

00:11:37,430  -->  00:11:40,020
that provides you with a subdomain on their server.
268

268

00:11:40,020  -->  00:11:43,160
For example, I use a service desk ticket tracking software
269

269

00:11:43,160  -->  00:11:46,600
known as Freshdesk, which it comes at freshdesk.com
270

270

00:11:46,600  -->  00:11:48,300
and they gave us a rather difficult to remember
271

271

00:11:48,300  -->  00:11:49,760
subdomain for their service,
272

272

00:11:49,760  -->  00:11:53,960
something like fdus-143-d15.freshdesk.com.
273

273

00:11:55,830  -->  00:11:58,950
So to make it easier for my staff to find our support desk,
274

274

00:11:58,950  -->  00:12:01,630
we create a CNAME record called Support,
275

275

00:12:01,630  -->  00:12:04,560
and we pointed that to this difficult to remember subdomain.
276

276

00:12:04,560  -->  00:12:08,000
So if my staff enter support.diontraining.com,
277

277

00:12:08,000  -->  00:12:10,130
it takes them right to our support system,
278

278

00:12:10,130  -->  00:12:12,970
which is actually redirecting us into this cloud instance,
279

279

00:12:12,970  -->  00:12:16,260
that's provided by the subdomain issued by Freshdesk.
280

280

00:12:16,260  -->  00:12:18,980
Remember, CNAME records cannot be used
281

281

00:12:18,980  -->  00:12:20,510
to point to an IP address.
282

282

00:12:20,510  -->  00:12:23,120
It can only be used to point to another domain name
283

283

00:12:23,120  -->  00:12:24,730
or subdomain name.
284

284

00:12:24,730  -->  00:12:26,690
Next, we have an MX record,
285

285

00:12:26,690  -->  00:12:28,740
which stands for mail exchange record,
286

286

00:12:28,740  -->  00:12:30,460
and it does what you think it would.
287

287

00:12:30,460  -->  00:12:33,180
It helps you figure out where an email server is.
288

288

00:12:33,180  -->  00:12:36,950
An MX record is used to direct emails to your mail server.
289

289

00:12:36,950  -->  00:12:38,670
The MX record is going to be used to indicate
290

290

00:12:38,670  -->  00:12:41,580
how email messages should be routed when they're using
291

291

00:12:41,580  -->  00:12:46,470
the SMTP or Simple Mail Transfer Protocol over port 25.
292

292

00:12:46,470  -->  00:12:49,500
MX records like CNAME records can only be used
293

293

00:12:49,500  -->  00:12:52,870
to point to another domain and not an IP address.
294

294

00:12:52,870  -->  00:12:54,430
When you create your MX records,
295

295

00:12:54,430  -->  00:12:56,500
you're also going to be able to provide the priority
296

296

00:12:56,500  -->  00:12:58,110
for each of these records.
297

297

00:12:58,110  -->  00:13:00,970
This lets you indicate your preference for which server
298

298

00:13:00,970  -->  00:13:03,290
the email should try to use first.
299

299

00:13:03,290  -->  00:13:05,000
When it comes to setting the priority,
300

300

00:13:05,000  -->  00:13:06,590
the lower the number you enter,
301

301

00:13:06,590  -->  00:13:08,220
the higher the priority it is.
302

302

00:13:08,220  -->  00:13:10,330
It's essentially golf rules.
303

303

00:13:10,330  -->  00:13:13,680
So if we have mail1.diontraining.com set at 10
304

304

00:13:13,680  -->  00:13:17,210
and mail2.diontraining.com set at 20 for their priorities,
305

305

00:13:17,210  -->  00:13:20,270
the emails are going to attempt to use mail one first.
306

306

00:13:20,270  -->  00:13:21,770
If it fails to reach mail one,
307

307

00:13:21,770  -->  00:13:23,950
then it will try to reach mail two.
308

308

00:13:23,950  -->  00:13:26,040
Now, if you want to load balance your email
309

309

00:13:26,040  -->  00:13:27,730
across multiple servers,
310

310

00:13:27,730  -->  00:13:30,840
you simply need to set their priorities to the same value.
311

311

00:13:30,840  -->  00:13:33,740
So if I created records for mail one and mail two,
312

312

00:13:33,740  -->  00:13:35,860
and they both had a priority of 10,
313

313

00:13:35,860  -->  00:13:38,060
all incoming emails are going to alternate
314

314

00:13:38,060  -->  00:13:40,340
and load balanced equally between these servers.
315

315

00:13:40,340  -->  00:13:41,600
The first one goes to one.
316

316

00:13:41,600  -->  00:13:44,130
The second one goes to two. The third one goes to one.
317

317

00:13:44,130  -->  00:13:46,660
The fourth one goes to two, and so on.
318

318

00:13:46,660  -->  00:13:48,610
Next, we have an SOA record,
319

319

00:13:48,610  -->  00:13:50,810
which stands for Start of Authority.
320

320

00:13:50,810  -->  00:13:52,700
Now, a Start of Authority record is used
321

321

00:13:52,700  -->  00:13:56,060
to store important information about a domain or a zone.
322

322

00:13:56,060  -->  00:13:57,560
This information can include things
323

323

00:13:57,560  -->  00:13:59,650
like when the domain was last updated,
324

324

00:13:59,650  -->  00:14:01,910
the email address of the administrator of the domain,
325

325

00:14:01,910  -->  00:14:03,860
or even how long the server should wait
326

326

00:14:03,860  -->  00:14:05,410
prior to sending an update for all
327

327

00:14:05,410  -->  00:14:08,050
of its DNS records to other zones.
328

328

00:14:08,050  -->  00:14:10,870
These Start of Authority records are critically important
329

329

00:14:10,870  -->  00:14:12,750
whenever a DNS server is attempting
330

330

00:14:12,750  -->  00:14:14,770
to conduct a zone transfer.
331

331

00:14:14,770  -->  00:14:17,770
Now, you may be wondering what is a zone transfer?
332

332

00:14:17,770  -->  00:14:20,730
Well, a DNS zone transfer is simply the process
333

333

00:14:20,730  -->  00:14:23,570
of sending your DNS records from the primary name server
334

334

00:14:23,570  -->  00:14:25,320
to a secondary name server.
335

335

00:14:25,320  -->  00:14:28,140
When this occurs, the first record that's transferred over
336

336

00:14:28,140  -->  00:14:31,000
is the SOA record, that Start of Authority.
337

337

00:14:31,000  -->  00:14:33,150
And this is used by the secondary server
338

338

00:14:33,150  -->  00:14:35,560
to see if the other records need to be updated
339

339

00:14:35,560  -->  00:14:37,230
because the Start of Authority record
340

340

00:14:37,230  -->  00:14:40,250
contains a serial number that acts as a type of versioning.
341

341

00:14:40,250  -->  00:14:41,640
When a zone transfer occurs,
342

342

00:14:41,640  -->  00:14:45,180
this is going to use the TCP protocol to do the data transfer.
343

343

00:14:45,180  -->  00:14:47,920
This ensures the data's going to be sent over successfully
344

344

00:14:47,920  -->  00:14:50,350
from the primary server to the secondary server
345

345

00:14:50,350  -->  00:14:52,970
and verify it has been received there.
346

346

00:14:52,970  -->  00:14:56,430
Next, we have a PTR record or a Pointer record.
347

347

00:14:56,430  -->  00:14:58,230
Now, a Pointer record is used to correlate
348

348

00:14:58,230  -->  00:15:00,300
an IP address with a domain name.
349

349

00:15:00,300  -->  00:15:03,740
Essentially a Pointer record is the opposite of an A record.
350

350

00:15:03,740  -->  00:15:06,030
These Pointer records are used to conduct what is known
351

351

00:15:06,030  -->  00:15:07,970
as a reverse DNS lookup.
352

352

00:15:07,970  -->  00:15:10,870
So if a user is trying to determine if a domain name
353

353

00:15:10,870  -->  00:15:12,960
is going to be used for a given IP,
354

354

00:15:12,960  -->  00:15:15,430
that query can be made against the Pointer records
355

355

00:15:15,430  -->  00:15:17,200
instead of the A records.
356

356

00:15:17,200  -->  00:15:20,780
This lets you go from an IP address to a domain name.
357

357

00:15:20,780  -->  00:15:23,050
Now, you may be wondering why do I even need
358

358

00:15:23,050  -->  00:15:25,890
a Pointer record if I already have an A record?
359

359

00:15:25,890  -->  00:15:28,410
Well, honestly, you don't always need them,
360

360

00:15:28,410  -->  00:15:30,580
but they can be helpful if you're trying to prove
361

361

00:15:30,580  -->  00:15:32,850
your domain is not associated with spam,
362

362

00:15:32,850  -->  00:15:35,360
if you're trying to troubleshoot an email delivery issue,
363

363

00:15:35,360  -->  00:15:36,930
or if you're trying to help create
364

364

00:15:36,930  -->  00:15:40,180
a better logging environment by converting your IP addresses
365

365

00:15:40,180  -->  00:15:42,000
back into domain names.
366

366

00:15:42,000  -->  00:15:44,810
Also, when you store an IP address in a Pointer record,
367

367

00:15:44,810  -->  00:15:49,780
it's going to be reversed and in-addr.arpa
368

368

00:15:49,780  -->  00:15:51,550
is added to it at the end.
369

369

00:15:51,550  -->  00:15:55,053
For example, if your IP was 66.55.44.33,
370

370

00:15:57,060  -->  00:15:59,000
and you're storing it in a Pointer record,
371

371

00:15:59,000  -->  00:16:03,197
it's actually going to be stored as 33.44.55.66.in-addr.arpa.
372

372

00:16:08,300  -->  00:16:10,100
Now, you might be wondering
373

373

00:16:10,100  -->  00:16:13,650
why is the top-level domain .arpa being used here,
374

374

00:16:13,650  -->  00:16:15,610
and what the heck does that mean?
375

375

00:16:15,610  -->  00:16:18,220
Well, the internet started out as the ARPANET,
376

376

00:16:18,220  -->  00:16:19,830
which stands for the Advanced Research
377

377

00:16:19,830  -->  00:16:21,550
Projects Agency Network.
378

378

00:16:21,550  -->  00:16:24,230
This was the first wide area packet switch network,
379

379

00:16:24,230  -->  00:16:26,220
and it was developed by the US military
380

380

00:16:26,220  -->  00:16:28,550
to connect a bunch of military defense researchers
381

381

00:16:28,550  -->  00:16:31,610
at universities located all over America.
382

382

00:16:31,610  -->  00:16:34,150
Now, the ARPA top-level domain was actually created
383

383

00:16:34,150  -->  00:16:36,690
as the first top-level domain that was defined
384

384

00:16:36,690  -->  00:16:40,370
for what would become the internet later on and as such,
385

385

00:16:40,370  -->  00:16:43,240
it was used for managing network infrastructure.
386

386

00:16:43,240  -->  00:16:47,090
This is why you see the .arpa as the top-level domain
387

387

00:16:47,090  -->  00:16:48,860
use by all Pointer records.
388

388

00:16:48,860  -->  00:16:51,310
It's just a relic of history and it's still there
389

389

00:16:51,310  -->  00:16:54,090
because we built the internet on top of ARPANET.
390

390

00:16:54,090  -->  00:16:57,020
For the exam, you don't need to know about ARPA
391

391

00:16:57,020  -->  00:16:59,480
or this internet history that I just talked about.
392

392

00:16:59,480  -->  00:17:00,860
It's just something that I have a lot of students
393

393

00:17:00,860  -->  00:17:04,480
ask me about, why do Pointer records end .arpa?
394

394

00:17:04,480  -->  00:17:05,770
And that's the reason.
395

395

00:17:05,770  -->  00:17:08,210
So when you conduct this type of lookup,
396

396

00:17:08,210  -->  00:17:09,790
you're trying to determine the host name
397

397

00:17:09,790  -->  00:17:11,340
based on a given IP.
398

398

00:17:11,340  -->  00:17:13,840
And this process is known as reverse DNS
399

399

00:17:13,840  -->  00:17:15,680
or a reverse lookup.
400

400

00:17:15,680  -->  00:17:19,000
Normally, when you use DNS, you do a forward lookup,
401

401

00:17:19,000  -->  00:17:22,270
which goes from a domain name to an IP address.
402

402

00:17:22,270  -->  00:17:25,320
Instead we're going from an IP address to a domain name
403

403

00:17:25,320  -->  00:17:27,400
and that's a reverse lookup.
404

404

00:17:27,400  -->  00:17:30,510
Next, we have TXT records or text records.
405

405

00:17:30,510  -->  00:17:32,910
Now, a text record is used by domain administrators
406

406

00:17:32,910  -->  00:17:36,610
to add texts into the Domain Name System or DNS.
407

407

00:17:36,610  -->  00:17:38,610
Originally, text records were designed
408

408

00:17:38,610  -->  00:17:40,750
as a way for us to add human-readable notes
409

409

00:17:40,750  -->  00:17:43,670
into our DNS records and over time,
410

410

00:17:43,670  -->  00:17:45,650
these things had more and more things
411

411

00:17:45,650  -->  00:17:47,660
starting to get added to these text records.
412

412

00:17:47,660  -->  00:17:50,800
And eventually, we started adding machine-readable data
413

413

00:17:50,800  -->  00:17:52,510
into these text records as well.
414

414

00:17:52,510  -->  00:17:54,790
And that's what you're going to see mostly these days.
415

415

00:17:54,790  -->  00:17:56,860
Your domain can have a lot of different text records
416

416

00:17:56,860  -->  00:17:59,440
as well, you're not limited to just one of them.
417

417

00:17:59,440  -->  00:18:01,620
Most of the time, you're going to see text records
418

418

00:18:01,620  -->  00:18:03,810
used to prove domain ownership through adding
419

419

00:18:03,810  -->  00:18:06,270
some machine-readable code for verification
420

420

00:18:06,270  -->  00:18:08,340
and to provide email spam prevention
421

421

00:18:08,340  -->  00:18:11,020
again, by adding specific machine readable code
422

422

00:18:11,020  -->  00:18:12,780
to a TXT record.
423

423

00:18:12,780  -->  00:18:15,130
For example, at diontraining.com,
424

424

00:18:15,130  -->  00:18:18,730
we have a text record with the name fdkey.support
425

425

00:18:18,730  -->  00:18:21,640
and a text string of 32 hexadecimal digits
426

426

00:18:21,640  -->  00:18:23,770
inside of our DNS records.
427

427

00:18:23,770  -->  00:18:26,800
This allows our support system Freshdesk to verify
428

428

00:18:26,800  -->  00:18:29,480
that we own the domain name, diontraining.com.
429

429

00:18:29,480  -->  00:18:31,940
So they're authorized to send out emails on our behalf
430

430

00:18:31,940  -->  00:18:33,960
to our students when our team replies
431

431

00:18:33,960  -->  00:18:36,660
inside their system to a support ticket.
432

432

00:18:36,660  -->  00:18:39,460
This is a form of domain ownership verification,
433

433

00:18:39,460  -->  00:18:41,970
because their system can query our DNS records
434

434

00:18:41,970  -->  00:18:43,890
and see that we entered this unique series
435

435

00:18:43,890  -->  00:18:48,180
of 32 hexadecimal digits into our DNS TXT record.
436

436

00:18:48,180  -->  00:18:50,187
Essentially, it's working like a password to say,
437

437

00:18:50,187  -->  00:18:52,690
"Hey, I own this domain."
438

438

00:18:52,690  -->  00:18:56,550
Next, let's talk about SRV records or Service records.
439

439

00:18:56,550  -->  00:18:59,430
Now, a Service record is used to specify a host and a port
440

440

00:18:59,430  -->  00:19:02,530
for a specific service such as voiceover IP,
441

441

00:19:02,530  -->  00:19:05,290
instant messaging or other services like that.
442

442

00:19:05,290  -->  00:19:09,270
Remember, we normally use an A record or an AAAA record
443

443

00:19:09,270  -->  00:19:11,220
when we're just associating a domain name
444

444

00:19:11,220  -->  00:19:14,900
with an IP address, either with IPv4 for an A record
445

445

00:19:14,900  -->  00:19:17,860
or IPv6 with an AAAA record.
446

446

00:19:17,860  -->  00:19:20,560
Now, we can use a CNAME record if we want to associate
447

447

00:19:20,560  -->  00:19:23,770
a domain name with a subdomain or another domain name,
448

448

00:19:23,770  -->  00:19:27,140
but none of these allowed us to specify a port,
449

449

00:19:27,140  -->  00:19:28,910
but with a Service record,
450

450

00:19:28,910  -->  00:19:32,160
we can specify a port along with our IP address.
451

451

00:19:32,160  -->  00:19:35,520
For example, if I wanted to run an XMPP chat server
452

452

00:19:35,520  -->  00:19:37,970
and link it to port 5223,
453

453

00:19:37,970  -->  00:19:41,690
I could do that with a Service record that looks like this,
454

454

00:19:41,690  -->  00:19:46,690
_xmpp._tcp.diontraining.com. Space 86400 space IN space SRV
455

455

00:19:52,560  -->  00:19:57,560
space 10 space 5 space 5223 space chat.diontraining.com.
456

456

00:19:58,960  -->  00:20:00,400
Whew! That's a mouthful.
457

457

00:20:00,400  -->  00:20:05,240
Now, that is a single SRV record in a DNS server.
458

458

00:20:05,240  -->  00:20:07,930
This would say that I'm using the XMPP service
459

459

00:20:07,930  -->  00:20:09,790
with the TCP protocol.
460

460

00:20:09,790  -->  00:20:12,360
The time to live for the record is going to be updated
461

461

00:20:12,360  -->  00:20:16,650
every 86,400 seconds, which is 24 hours.
462

462

00:20:16,650  -->  00:20:19,930
The class is set to IN, which stands for Internet
463

463

00:20:19,930  -->  00:20:22,580
and it's an SRV or Service record.
464

464

00:20:22,580  -->  00:20:25,290
The priority is 10 and the weight is five.
465

465

00:20:25,290  -->  00:20:27,530
These two settings are used for prioritization
466

466

00:20:27,530  -->  00:20:30,310
and load balancing across multiple servers.
467

467

00:20:30,310  -->  00:20:32,440
Finally, we see the port number 5223,
468

468

00:20:33,310  -->  00:20:37,150
and the target server of chat.diontraining.com.
469

469

00:20:37,150  -->  00:20:39,060
This is the port and server we're mapping
470

470

00:20:39,060  -->  00:20:43,250
the XMPP service to within this particular Service record.
471

471

00:20:43,250  -->  00:20:45,370
Finally, we have an NS record
472

472

00:20:45,370  -->  00:20:47,650
which stands for name server record.
473

473

00:20:47,650  -->  00:20:49,760
Now, a name server record is used to indicate
474

474

00:20:49,760  -->  00:20:51,960
which DNS name server in the world
475

475

00:20:51,960  -->  00:20:55,220
is going be the authoritative one for that domain.
476

476

00:20:55,220  -->  00:20:58,190
This is important because DNS uses that hierarchal model
477

477

00:20:58,190  -->  00:21:00,550
we talked about and all the servers need to know
478

478

00:21:00,550  -->  00:21:02,900
who owns that record and is authorized
479

479

00:21:02,900  -->  00:21:04,550
to make the changes to it.
480

480

00:21:04,550  -->  00:21:07,330
Now, a name server is a type of DNS server
481

481

00:21:07,330  -->  00:21:10,490
that stores all the DNS records for a given domain,
482

482

00:21:10,490  -->  00:21:12,850
including all the types we've already discussed,
483

483

00:21:12,850  -->  00:21:16,950
like A record, AAAA records, Canonical Name records,
484

484

00:21:16,950  -->  00:21:20,630
MX, mail exchange records, TXT, text records,
485

485

00:21:20,630  -->  00:21:24,340
PTR, Pointer records, and SRV, Service records.
486

486

00:21:24,340  -->  00:21:26,340
There are often more than one name server
487

487

00:21:26,340  -->  00:21:28,600
for domain as well, so you can have a primary
488

488

00:21:28,600  -->  00:21:30,520
and a backup name server.
489

489

00:21:30,520  -->  00:21:32,310
Additionally, you don't always have to host
490

490

00:21:32,310  -->  00:21:33,500
your own name servers.
491

491

00:21:33,500  -->  00:21:35,250
In the case of diontraining.com,
492

492

00:21:35,250  -->  00:21:36,960
we don't host our own name servers,
493

493

00:21:36,960  -->  00:21:39,120
instead we rely on Cloudflare,
494

494

00:21:39,120  -->  00:21:42,080
which is a cloud service provider that does this for us.
495

495

00:21:42,080  -->  00:21:45,440
So if you look up the DNS records for diontraining.com,
496

496

00:21:45,440  -->  00:21:46,990
the authoritative source for that
497

497

00:21:46,990  -->  00:21:49,530
is to of Cloudflare's name servers.
498

498

00:21:49,530  -->  00:21:52,020
Now, up to this point, I've talked about DNS
499

499

00:21:52,020  -->  00:21:54,310
from a perspective of hosting a publicly available
500

500

00:21:54,310  -->  00:21:57,280
DNS server that anyone in the world can access,
501

501

00:21:57,280  -->  00:22:01,160
but DNS can actually be used internally or externally.
502

502

00:22:01,160  -->  00:22:02,900
Everything I've talked about so far
503

503

00:22:02,900  -->  00:22:04,610
is talking about externally.
504

504

00:22:04,610  -->  00:22:07,490
But let's talk a little bit about internally.
505

505

00:22:07,490  -->  00:22:09,200
These days with cloud computing,
506

506

00:22:09,200  -->  00:22:12,640
it is very common to set up an internal DNS servers as well,
507

507

00:22:12,640  -->  00:22:15,380
that lets your cloud instances within the same network
508

508

00:22:15,380  -->  00:22:19,290
or private cloud access each other using internal DNS names,
509

509

00:22:19,290  -->  00:22:22,000
instead of having to use their IP addresses.
510

510

00:22:22,000  -->  00:22:24,020
To do this internal A records are created,
511

511

00:22:24,020  -->  00:22:26,210
an internal Pointer records are also created
512

512

00:22:26,210  -->  00:22:27,780
in the reverse zone.
513

513

00:22:27,780  -->  00:22:31,040
Luckily, most cloud providers will automatically create,
514

514

00:22:31,040  -->  00:22:33,870
update, and remove these internal DNS records for you
515

515

00:22:33,870  -->  00:22:36,250
as you create and remove different virtual machines
516

516

00:22:36,250  -->  00:22:38,950
and other instances in your private cloud.
517

517

00:22:38,950  -->  00:22:40,970
External DNS is what most of us
518

518

00:22:40,970  -->  00:22:42,740
are going to be more familiar with though.
519

519

00:22:42,740  -->  00:22:44,360
These are the records that are created around
520

520

00:22:44,360  -->  00:22:47,010
the domain names that we purchase from a central authority
521

521

00:22:47,010  -->  00:22:49,180
and that we use on the public internet.
522

522

00:22:49,180  -->  00:22:50,760
Now, for each DNS record,
523

523

00:22:50,760  -->  00:22:54,360
we also have what's known as a TTL or time to live
524

524

00:22:54,360  -->  00:22:55,870
that's associated with it.
525

525

00:22:55,870  -->  00:22:58,150
Now, inside of each of our DNS records,
526

526

00:22:58,150  -->  00:23:00,590
whether internal or external, we're going to create
527

527

00:23:00,590  -->  00:23:03,320
what's known as a TTL or time to live
528

528

00:23:03,320  -->  00:23:04,860
that's associated with it.
529

529

00:23:04,860  -->  00:23:07,830
The time to live is a setting that tells the DNS resolver
530

530

00:23:07,830  -->  00:23:11,330
how long it can cache a query before requesting a new one.
531

531

00:23:11,330  -->  00:23:14,210
So if my DNS records are set with a time to live
532

532

00:23:14,210  -->  00:23:18,160
of 86,400 seconds, which is usually the default,
533

533

00:23:18,160  -->  00:23:21,180
that means my computer will resolve that DNS record
534

534

00:23:21,180  -->  00:23:23,510
and it will remember it for 24 hours
535

535

00:23:23,510  -->  00:23:25,870
before it has to go back out to the DNS server
536

536

00:23:25,870  -->  00:23:27,950
and ask for that information again.
537

537

00:23:27,950  -->  00:23:31,010
This DNS resolver also known as a DNS cache
538

538

00:23:31,010  -->  00:23:33,210
is located on your individual hosts.
539

539

00:23:33,210  -->  00:23:35,670
So if you're running windows 10, for example,
540

540

00:23:35,670  -->  00:23:38,830
your computer is making a local copy of every DNS entry
541

541

00:23:38,830  -->  00:23:41,100
it resolves as you connect to websites
542

542

00:23:41,100  -->  00:23:42,480
all over the internet.
543

543

00:23:42,480  -->  00:23:44,730
This temporary database remembers the answers
544

544

00:23:44,730  -->  00:23:46,750
that received from the DNS server.
545

545

00:23:46,750  -->  00:23:48,780
So if you go to diontraining.com,
546

546

00:23:48,780  -->  00:23:50,420
the first time you do that today,
547

547

00:23:50,420  -->  00:23:53,500
your computer has to ask the DNS server for that IP address,
548

548

00:23:53,500  -->  00:23:55,350
but now it knows where it is,
549

549

00:23:55,350  -->  00:23:58,160
and it remembers that IP for the next 24 hours.
550

550

00:23:58,160  -->  00:24:00,400
If you visit my website five times today,
551

551

00:24:00,400  -->  00:24:02,910
you only had to look up that IP address once.
552

552

00:24:02,910  -->  00:24:05,450
This helps speed up the entire process for us.
553

553

00:24:05,450  -->  00:24:06,820
Now, if you try again tomorrow,
554

554

00:24:06,820  -->  00:24:09,380
your computer's going to first check it's DNS cache,
555

555

00:24:09,380  -->  00:24:11,080
and it's going to see there's a record there.
556

556

00:24:11,080  -->  00:24:13,320
But if that time to live is already passed,
557

557

00:24:13,320  -->  00:24:14,840
it's going to invalidate that record
558

558

00:24:14,840  -->  00:24:16,710
and perform another lookup.
559

559

00:24:16,710  -->  00:24:18,080
The final thing we need to cover
560

560

00:24:18,080  -->  00:24:20,470
is the concept of a recursive lookup.
561

561

00:24:20,470  -->  00:24:22,830
You see, when your computer wants to find a given website
562

562

00:24:22,830  -->  00:24:24,350
like diontraining.com,
563

563

00:24:24,350  -->  00:24:27,610
it first has to ask its DNS server where it's located.
564

564

00:24:27,610  -->  00:24:29,010
So if you're sitting at home
565

565

00:24:29,010  -->  00:24:31,600
and using a Verizon Fios connection, for example,
566

566

00:24:31,600  -->  00:24:34,393
you're going to ask their DNS server, who's diontraining.com?
567

567

00:24:35,300  -->  00:24:38,530
Now, Verizon's DNS may or may not know the IP address
568

568

00:24:38,530  -->  00:24:40,030
for diontraining.com.
569

569

00:24:40,030  -->  00:24:41,990
After all, there are millions and millions
570

570

00:24:41,990  -->  00:24:43,160
of websites out there.
571

571

00:24:43,160  -->  00:24:45,880
If they had to rethink our records every 24 hours,
572

572

00:24:45,880  -->  00:24:47,700
that would take a long time.
573

573

00:24:47,700  -->  00:24:51,150
So instead DNS uses this recursive strategy
574

574

00:24:51,150  -->  00:24:52,380
to perform the lookup.
575

575

00:24:52,380  -->  00:24:55,640
So you ask Verizon, and if they don't know the answer,
576

576

00:24:55,640  -->  00:24:58,590
they're going to go up a level and ask the next DNS server.
577

577

00:24:58,590  -->  00:25:00,010
If that server doesn't know the answer,
578

578

00:25:00,010  -->  00:25:01,290
it will go up another level
579

579

00:25:01,290  -->  00:25:04,110
and we'll keep this process going until it finds somebody
580

580

00:25:04,110  -->  00:25:07,180
who knows the IP address of diontraining.com.
581

581

00:25:07,180  -->  00:25:08,550
Now, if during this recursion,
582

582

00:25:08,550  -->  00:25:11,200
it reaches all the way up to the .com or the root domain
583

583

00:25:11,200  -->  00:25:14,960
for diontraining.com, then it can ask the .com root server,
584

584

00:25:14,960  -->  00:25:18,330
which DNS server is authoritative for diontraining.com
585

585

00:25:18,330  -->  00:25:21,130
and get the authoritative answer directly from them.
586

586

00:25:21,130  -->  00:25:22,880
Essentially with a recursive lookup,
587

587

00:25:22,880  -->  00:25:24,577
your DNS resolver saying,
588

588

00:25:24,577  -->  00:25:26,660
"I don't know what this domain's IP is,
589

589

00:25:26,660  -->  00:25:28,600
but I'm going to ask my DNS server
590

590

00:25:28,600  -->  00:25:31,060
and that server will hunt it down until it finds it.
591

591

00:25:31,060  -->  00:25:32,930
And then tell me that IP."
592

592

00:25:32,930  -->  00:25:34,550
Now, there's another method that can be used,
593

593

00:25:34,550  -->  00:25:36,410
which is known as an iterative lookup.
594

594

00:25:36,410  -->  00:25:39,320
With an iterative lookup, it's similar to recursive lookup,
595

595

00:25:39,320  -->  00:25:41,770
except that the DNS server is not going to continue
596

596

00:25:41,770  -->  00:25:44,620
to look up the information for you and send you the result
597

597

00:25:44,620  -->  00:25:46,520
instead in an iterative lookup,
598

598

00:25:46,520  -->  00:25:49,350
your DNS resolver is going to ask the DNS server
599

599

00:25:49,350  -->  00:25:51,100
what the IP for the domain is.
600

600

00:25:51,100  -->  00:25:53,160
And if the DNS server doesn't know,
601

601

00:25:53,160  -->  00:25:56,150
it's going to tell your resolver to ask the next DNS server,
602

602

00:25:56,150  -->  00:25:58,620
and that server will provide its IP.
603

603

00:25:58,620  -->  00:26:00,580
Now, with the recursive lookup,
604

604

00:26:00,580  -->  00:26:01,870
the DNS server would hunt it down
605

605

00:26:01,870  -->  00:26:03,470
and report back to resolver.
606

606

00:26:03,470  -->  00:26:05,180
But with an iterative lookup,
607

607

00:26:05,180  -->  00:26:08,320
your DNS resolver is going to continually doing this query
608

608

00:26:08,320  -->  00:26:10,150
all the way up through this recursion
609

609

00:26:10,150  -->  00:26:13,110
until it finds the one with the IP for that domain.
610

610

00:26:13,110  -->  00:26:15,130
So it really is just a matter of who's doing
611

611

00:26:15,130  -->  00:26:17,070
the hunting for this information.
612

612

00:26:17,070  -->  00:26:17,903
All right.
613

613

00:26:17,903  -->  00:26:20,320
We have covered a lot of information in this lesson.
614

614

00:26:20,320  -->  00:26:22,020
So as a quick summary,
615

615

00:26:22,020  -->  00:26:24,090
what do you need to know for the exam?
616

616

00:26:24,090  -->  00:26:26,650
Well, you need to understand how DNS works
617

617

00:26:26,650  -->  00:26:29,490
by using its various record types to convert domain names
618

618

00:26:29,490  -->  00:26:32,650
to IP addresses and IP addresses to domain names.
619

619

00:26:32,650  -->  00:26:33,970
You should remember that A records
620

620

00:26:33,970  -->  00:26:36,860
are used for domain names and IPv4 addresses,
621

621

00:26:36,860  -->  00:26:39,660
while AAAA records are used for domain names
622

622

00:26:39,660  -->  00:26:41,610
with IPv6 addresses.
623

623

00:26:41,610  -->  00:26:43,840
CNAME records are used to map domain names
624

624

00:26:43,840  -->  00:26:45,520
to other domain names.
625

625

00:26:45,520  -->  00:26:47,250
MX records are used for email
626

626

00:26:47,250  -->  00:26:49,690
and NS records are used for name servers,
627

627

00:26:49,690  -->  00:26:52,500
TXT records store texts, either as human-readable
628

628

00:26:52,500  -->  00:26:54,170
or machine-readable data.
629

629

00:26:54,170  -->  00:26:56,500
Pointer records are used to match up an IP address
630

630

00:26:56,500  -->  00:26:58,950
with a domain name for reverse DNS lookups
631

631

00:26:58,950  -->  00:27:02,350
and Service records are used to map both a port and an IP
632

632

00:27:02,350  -->  00:27:04,360
to a domain name for a service.
633

633

00:27:04,360  -->  00:27:06,640
If you remember that summary, you should be able to answer
634

634

00:27:06,640  -->  00:27:08,550
pretty much most of the DNS questions
635

635

00:27:08,550  -->  00:27:10,000
you're going to see on the exam.
