1
00:00:00,178 --> 00:00:01,910
- [Instructor] Hi and
welcome back to the course.

2
00:00:01,910 --> 00:00:03,550
In this video, we're going to quickly look

3
00:00:03,550 --> 00:00:06,550
at how the Domain Name System works.

4
00:00:07,949 --> 00:00:10,852
In the left here in this
diagram we've got your browser

5
00:00:10,852 --> 00:00:14,435
and let's say you're
accessing example.com.

6
00:00:15,340 --> 00:00:16,968
Now, your browser doesn't know

7
00:00:16,968 --> 00:00:19,259
the IP address for example.com,

8
00:00:19,259 --> 00:00:21,810
so the first thing it
does is it checks to see

9
00:00:21,810 --> 00:00:25,540
if the operating system
knows the IP address.

10
00:00:25,540 --> 00:00:30,022
This can happen if you've
accessed it recently, for example.

11
00:00:30,022 --> 00:00:32,556
Now, if the operating
system knows the IP address,

12
00:00:32,556 --> 00:00:35,285
then that's fine, it
goes back to the browser

13
00:00:35,285 --> 00:00:39,157
and that'll loads the IP
address and all is good.

14
00:00:39,157 --> 00:00:41,915
However, normally the operating system

15
00:00:41,915 --> 00:00:45,925
won't know the IP address
for a given domain.

16
00:00:45,925 --> 00:00:49,092
So what happens is a DNS query begins.

17
00:00:50,917 --> 00:00:52,343
Now, the first thing that happens

18
00:00:52,343 --> 00:00:53,176
is because

19
00:00:56,088 --> 00:00:58,839
the domains are so numerous,

20
00:00:58,839 --> 00:01:02,341
there are so many domains
many millions of them,

21
00:01:02,341 --> 00:01:05,674
it is not a single server that tells you

22
00:01:06,619 --> 00:01:09,494
where the IP address
for a given domain is.

23
00:01:09,494 --> 00:01:12,261
So, it goes through a number of steps

24
00:01:12,261 --> 00:01:15,709
in trying to find out the IP address

25
00:01:15,709 --> 00:01:18,260
related to a single domain.

26
00:01:18,260 --> 00:01:19,613
The first thing that happens

27
00:01:19,613 --> 00:01:22,530
is we go to one of the root servers

28
00:01:23,824 --> 00:01:28,642
and these are hard-coded in
the internet provider's system.

29
00:01:28,642 --> 00:01:31,975
So, there are a few hundred root servers

30
00:01:33,488 --> 00:01:36,087
and when new root servers are added

31
00:01:36,087 --> 00:01:40,109
then all of the internet providers update

32
00:01:40,109 --> 00:01:41,830
and add the new root servers.

33
00:01:41,830 --> 00:01:43,777
And that doesn't happen that often.

34
00:01:43,777 --> 00:01:48,339
There's a number of companies
that manage the root servers

35
00:01:48,339 --> 00:01:49,597
and all is good.

36
00:01:49,597 --> 00:01:53,510
So, the first thing that happens
is we go to a root server

37
00:01:53,510 --> 00:01:55,481
and the root server will tell us,

38
00:01:55,481 --> 00:01:58,116
"I don't know anything about example.com

39
00:01:58,116 --> 00:02:02,283
"that's way too specific,
but I know about the .com."

40
00:02:04,459 --> 00:02:06,520
So, it'll tell us

41
00:02:06,520 --> 00:02:09,687
the IP addresses for the .com servers.

42
00:02:11,587 --> 00:02:12,551
Okay.

43
00:02:12,551 --> 00:02:15,636
So, then the browser is like,
"Okay, now I know .com."

44
00:02:15,636 --> 00:02:18,024
That's the first part of the address.

45
00:02:18,024 --> 00:02:22,811
That's the top-level domain,
a TLD commonly called.

46
00:02:22,811 --> 00:02:27,602
So, what it does is it then
goes to the .com servers.

47
00:02:27,602 --> 00:02:31,062
These are TLD servers and
these are also managed

48
00:02:31,062 --> 00:02:33,294
by specific organisations,

49
00:02:33,294 --> 00:02:35,988
I think Verisign is one
of the organisations

50
00:02:35,988 --> 00:02:39,133
that manages the .com domains.

51
00:02:39,133 --> 00:02:41,348
And it asks, "Okay, do you know anything

52
00:02:41,348 --> 00:02:43,071
"about "example.com's IP address?

53
00:02:43,071 --> 00:02:46,322
"What's the IP address of example.com?"

54
00:02:46,322 --> 00:02:48,113
And this TLD server will say,

55
00:02:48,113 --> 00:02:51,822
"I don't know the IP
address of example.com,

56
00:02:51,822 --> 00:02:55,352
"but I know the IP address of the server

57
00:02:55,352 --> 00:02:57,640
"that knows the IP
address of example.com."

58
00:02:57,640 --> 00:02:59,808
So, it gives (mumbles) of that.

59
00:02:59,808 --> 00:03:03,995
And then at the end, the last
step is to go to the server

60
00:03:03,995 --> 00:03:06,083
that knows the IP address and ask it,

61
00:03:06,083 --> 00:03:08,619
"What's the IP address of example.com?"

62
00:03:08,619 --> 00:03:11,859
And then, that tells us the
IP address of example.com,

63
00:03:11,859 --> 00:03:13,684
which is that down here,

64
00:03:13,684 --> 00:03:17,267
and the browser then
loads that IP address.

65
00:03:19,045 --> 00:03:22,403
So the first thing, is to
go to a root name server.

66
00:03:22,403 --> 00:03:25,924
That tells us the top-level
domain name servers.

67
00:03:25,924 --> 00:03:29,700
That tells us the
authoritative name servers.

68
00:03:29,700 --> 00:03:34,352
And that tells us the IP
address, which we then load.

69
00:03:34,352 --> 00:03:36,435
Going back to Cloudflare,

70
00:03:37,852 --> 00:03:41,602
what we've set up here
beth.ns.cloudflare.com

71
00:03:42,844 --> 00:03:45,619
and justin.ns.cloudflare.com,

72
00:03:45,619 --> 00:03:49,575
those are the authoritative name servers.

73
00:03:49,575 --> 00:03:51,827
So, those are the servers that know

74
00:03:51,827 --> 00:03:54,668
the IP address of example.com,

75
00:03:54,668 --> 00:03:57,835
or in our case restapicoursetrial.com.

76
00:03:59,838 --> 00:04:03,590
And in our DNS settings,
which we can go up here,

77
00:04:03,590 --> 00:04:06,536
we can go to the DNS settings,

78
00:04:06,536 --> 00:04:07,786
we have defined

79
00:04:09,551 --> 00:04:11,699
that IP address.

80
00:04:11,699 --> 00:04:15,149
Whenever we go to one of
those two name servers,

81
00:04:15,149 --> 00:04:18,799
they will know okay this A record exists,

82
00:04:18,799 --> 00:04:21,620
restapicoursetrial.com and they'll give

83
00:04:21,620 --> 00:04:23,953
the browser this IP address.

84
00:04:25,426 --> 00:04:26,612
Okay.

85
00:04:26,612 --> 00:04:28,408
So, that's how the Domain Name System,

86
00:04:28,408 --> 00:04:30,538
in a very simplified fashion, works.

87
00:04:30,538 --> 00:04:31,838
In the description of the lecture,

88
00:04:31,838 --> 00:04:33,578
I'm going to put a couple more links

89
00:04:33,578 --> 00:04:37,931
to see if you want more
info, you can go to that.

90
00:04:37,931 --> 00:04:40,348
But, next steps are to modify

91
00:04:41,186 --> 00:04:44,046
our DNS settings so they are correct,

92
00:04:44,046 --> 00:04:46,435
because right now they
are not really correct.

93
00:04:46,435 --> 00:04:48,605
We've got a bunch of
settings that we don't need,

94
00:04:48,605 --> 00:04:50,432
such as the MX settings,

95
00:04:50,432 --> 00:04:52,353
and we've got a bunch of
settings that are wrong,

96
00:04:52,353 --> 00:04:54,934
like the A and the C name records.

97
00:04:54,934 --> 00:04:57,019
So in the very next
video, let's change them

98
00:04:57,019 --> 00:04:58,403
and make sure they are correct

99
00:04:58,403 --> 00:05:01,375
and they are pointing to the right server.

100
00:05:01,375 --> 00:05:03,456
I'll see you in the very next video.

