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