1
00:00:00,429 --> 00:00:02,042
- [Narrator] Hi and
welcome back to the class.

2
00:00:02,042 --> 00:00:04,037
In this video we're going to be setting up

3
00:00:04,037 --> 00:00:07,583
our DNS settings using Cloudflare.

4
00:00:07,583 --> 00:00:10,752
Cloudflare is a Content Delivery Network.

5
00:00:10,752 --> 00:00:13,937
Commonly known as a CDN and what it does

6
00:00:13,937 --> 00:00:16,086
is it sits in front of our server.

7
00:00:16,086 --> 00:00:19,631
So whenever anybody accesses our domain,

8
00:00:19,631 --> 00:00:23,127
they will, actually, be
accessing Cloudflare.

9
00:00:23,127 --> 00:00:24,280
Because it sits in front,

10
00:00:24,280 --> 00:00:27,586
it lets us do things like store our site

11
00:00:27,586 --> 00:00:30,502
on their servers so it's faster.

12
00:00:30,502 --> 00:00:33,131
Or it gives us security and it lets us

13
00:00:33,131 --> 00:00:35,929
prevent any denial-of-service attacks

14
00:00:35,929 --> 00:00:37,954
and a bunch more stuff.

15
00:00:37,954 --> 00:00:40,456
It's, really, a nice
product and it's also free

16
00:00:40,456 --> 00:00:42,354
if you have low amounts of traffic.

17
00:00:42,354 --> 00:00:46,670
So we're gonna learn how
to us it in this video.

18
00:00:46,670 --> 00:00:48,806
The first thing we'll
want to do is sign up

19
00:00:48,806 --> 00:00:49,944
and that's fairly simple.

20
00:00:49,944 --> 00:00:51,583
Just an email and a password.

21
00:00:51,583 --> 00:00:55,581
And as I said, you don't
have to pay at all.

22
00:00:55,581 --> 00:00:56,985
Once you've signed up,

23
00:00:56,985 --> 00:00:59,180
you will be received and
logged in, of course.

24
00:00:59,180 --> 00:01:02,157
You will be received through
the website like this one.

25
00:01:02,157 --> 00:01:05,226
And here is where you
can add your website.

26
00:01:05,226 --> 00:01:07,707
If you don't see this page, specifically,

27
00:01:07,707 --> 00:01:10,290
just go to the Add Site button.

28
00:01:11,889 --> 00:01:12,813
What we're gonna do here

29
00:01:12,813 --> 00:01:14,424
and what Cloudflare wants to know

30
00:01:14,424 --> 00:01:16,674
is what our domain name is.

31
00:01:18,490 --> 00:01:20,461
We've bought our domain name

32
00:01:20,461 --> 00:01:22,395
and we can just enter it here.

33
00:01:22,395 --> 00:01:24,978
It is rest-api-course-trial.com

34
00:01:29,992 --> 00:01:33,883
And then we're gonna begin this scanning.

35
00:01:33,883 --> 00:01:35,258
What it's doing now is it's finding

36
00:01:35,258 --> 00:01:39,341
that we are, actually,
the owners of this domain.

37
00:01:41,532 --> 00:01:45,699
Or rather, this domain has
been registered by somebody.

38
00:01:50,390 --> 00:01:53,729
Now that it has scanned,
we can continue the setup

39
00:01:53,729 --> 00:01:56,754
and that's what we're gonna do.

40
00:01:56,754 --> 00:01:58,821
Here we can see that there are

41
00:01:58,821 --> 00:02:01,391
a bunch of things going on on the screen.

42
00:02:01,391 --> 00:02:05,533
We don't, really, know what's happening.

43
00:02:05,533 --> 00:02:08,950
Let's find out, exactly, what's going on.

44
00:02:11,780 --> 00:02:13,540
It's asking us to verify that all

45
00:02:13,540 --> 00:02:15,960
our DNS records are listed.

46
00:02:15,960 --> 00:02:17,960
So what is a DNS record?

47
00:02:18,895 --> 00:02:20,590
I mentioned in the last video

48
00:02:20,590 --> 00:02:24,090
that the Domain Name System is what allows

49
00:02:24,956 --> 00:02:29,554
a browser to enter a
string on the address bar

50
00:02:29,554 --> 00:02:32,971
and then goes to a particular IP address.

51
00:02:35,253 --> 00:02:39,336
As we can see, we've got
a row on this table here

52
00:02:40,735 --> 00:02:43,842
that says rest-api-course-trial.com

53
00:02:43,842 --> 00:02:46,485
which is our domain name,

54
00:02:46,485 --> 00:02:48,568
points to 192.64.119.216.

55
00:02:51,286 --> 00:02:55,144
So this is our IP address
and that's our domain name.

56
00:02:55,144 --> 00:02:57,330
And indeed, what'll happen because

57
00:02:57,330 --> 00:03:00,798
of this DNS setting is that when we put

58
00:03:00,798 --> 00:03:03,505
rest-api-course-trial.com on our browser,

59
00:03:03,505 --> 00:03:07,672
really our browser is going
to be going to 192.64.119.216.

60
00:03:10,602 --> 00:03:12,998
So that's what this first record means.

61
00:03:12,998 --> 00:03:17,011
And, evidently, that's not
the IP address of our server.

62
00:03:17,011 --> 00:03:19,974
That is an IP address that Namecheap owns

63
00:03:19,974 --> 00:03:23,974
and that they serve for
us until we set our own.

64
00:03:26,551 --> 00:03:29,278
Then we've got a C name record.

65
00:03:29,278 --> 00:03:32,361
And the C name says www and this says

66
00:03:33,678 --> 00:03:38,615
that this is an alias of
parkingpage.namecheap.com.

67
00:03:38,615 --> 00:03:41,845
So we'll investigate,
exactly, what this means

68
00:03:41,845 --> 00:03:45,085
in a few minutes when we set up our own.

69
00:03:45,085 --> 00:03:46,470
But, essentially, all that's doing

70
00:03:46,470 --> 00:03:50,637
is that when we access
www.rest-api-course-trial.com,

71
00:03:51,767 --> 00:03:55,320
really what we're accessing
is parkingpage.namecheap.com.

72
00:03:55,320 --> 00:03:58,367
So, essentially, it's like
a redirection sort of thing.

73
00:03:58,367 --> 00:04:01,392
And then we've got a bunch of MX records

74
00:04:01,392 --> 00:04:04,343
and these are for email exchange

75
00:04:04,343 --> 00:04:08,357
and these are in case we want to set up

76
00:04:08,357 --> 00:04:12,440
our email clients to use
our domain name, really.

77
00:04:15,493 --> 00:04:19,166
We're not gonna be using
that in this course.

78
00:04:19,166 --> 00:04:21,537
And finally, we've got a TXT record.

79
00:04:21,537 --> 00:04:23,906
A TXT record, all that that is is just

80
00:04:23,906 --> 00:04:27,406
a piece of text stored against our domain.

81
00:04:28,451 --> 00:04:30,805
So in this case, we've got a string

82
00:04:30,805 --> 00:04:35,689
that says v=spf1 include:
blah, blah, blah, blah, blah.

83
00:04:35,689 --> 00:04:38,267
And that's just this piece of text

84
00:04:38,267 --> 00:04:41,958
that is stored against our domain name.

85
00:04:41,958 --> 00:04:43,589
The browser doesn't use it,

86
00:04:43,589 --> 00:04:47,506
it's only used by a domain
name system servers.

87
00:04:51,080 --> 00:04:52,762
Now we've got all this stuff here

88
00:04:52,762 --> 00:04:56,929
and, evidently, this is not
our IP address, for example.

89
00:04:59,859 --> 00:05:02,039
We don't own this alias either

90
00:05:02,039 --> 00:05:05,799
and we don't, really,
own these mail handlers.

91
00:05:05,799 --> 00:05:07,854
But we're gonna except this for now

92
00:05:07,854 --> 00:05:10,051
just because they are the default settings

93
00:05:10,051 --> 00:05:11,409
and we're gonna change them in a minute.

94
00:05:11,409 --> 00:05:13,409
So let's press Continue.

95
00:05:14,778 --> 00:05:17,287
Then it asks us to select a plan.

96
00:05:17,287 --> 00:05:20,196
We're gonna go for Free Website.

97
00:05:20,196 --> 00:05:24,063
And what this says is
Basic Security Protection

98
00:05:24,063 --> 00:05:26,478
which isn't much but it is something.

99
00:05:26,478 --> 00:05:29,975
It allows us to improve
the performance of our site

100
00:05:29,975 --> 00:05:33,442
because it caches the
contents of the site.

101
00:05:33,442 --> 00:05:37,161
It stores the contents
in Cloudflare servers

102
00:05:37,161 --> 00:05:39,997
so the access to them is faster.

103
00:05:39,997 --> 00:05:42,224
It gives us a SSL certificate

104
00:05:42,224 --> 00:05:44,088
which is something we're interested in

105
00:05:44,088 --> 00:05:46,197
and that, essentially,
allows us to encrypt

106
00:05:46,197 --> 00:05:49,966
communication between browser and servers.

107
00:05:49,966 --> 00:05:52,135
We're gonna look at,
exactly, how that works

108
00:05:52,135 --> 00:05:53,694
in the coming videos.

109
00:05:53,694 --> 00:05:55,225
And finally, it also give us the

110
00:05:55,225 --> 00:05:57,257
Always Online which is a protection

111
00:05:57,257 --> 00:06:01,257
against being down and
our server going offline.

112
00:06:02,486 --> 00:06:05,303
The other plans, of course,
give you more things.

113
00:06:05,303 --> 00:06:08,666
For example, the Pro gives you more

114
00:06:08,666 --> 00:06:10,477
extra protection in all the browsers

115
00:06:10,477 --> 00:06:12,706
as opposed to only the main browsers.

116
00:06:12,706 --> 00:06:14,596
And it gives you a bunch
of more stuff and so on.

117
00:06:14,596 --> 00:06:16,285
But, evidently, they get a bit expensive

118
00:06:16,285 --> 00:06:18,357
so we're gonna stick
to the free one for now

119
00:06:18,357 --> 00:06:22,524
and we can always go to
the next one if we need it.

120
00:06:24,813 --> 00:06:27,721
Finally, we're gonna update name servers.

121
00:06:27,721 --> 00:06:30,119
This is important and we're gonna look

122
00:06:30,119 --> 00:06:33,489
at why this matters in
the very next video.

123
00:06:33,489 --> 00:06:35,215
But what it's saying is that we have

124
00:06:35,215 --> 00:06:37,382
to change the DNS servers,

125
00:06:38,464 --> 00:06:40,163
the main name servers.

126
00:06:40,163 --> 00:06:43,019
The way we do this is we take a copy

127
00:06:43,019 --> 00:06:45,524
of the name servers that are asking

128
00:06:45,524 --> 00:06:47,523
us to change to.

129
00:06:47,523 --> 00:06:51,690
So beth.ns.cloudflare.com
and Justin.ns.cloudflare.com.

130
00:06:53,747 --> 00:06:57,830
And then we go to Namecheap
and in our dashboard,

131
00:06:59,157 --> 00:07:01,959
just make sure to log in to your account.

132
00:07:01,959 --> 00:07:04,042
And go to your dashboard.

133
00:07:06,613 --> 00:07:10,780
We're going to go into the
domain that we've bought.

134
00:07:11,901 --> 00:07:14,651
Here we're going to go to Manage.

135
00:07:17,515 --> 00:07:19,637
And finally, we're going to change

136
00:07:19,637 --> 00:07:21,720
the name servers section.

137
00:07:23,262 --> 00:07:25,615
So instead of Namecheap BasicDNS,

138
00:07:25,615 --> 00:07:27,948
we're gonna go for custom DNS

139
00:07:27,948 --> 00:07:31,365
and we're gonna add Beth and Justin here.

140
00:07:34,473 --> 00:07:36,473
And then press the tick.

141
00:07:38,191 --> 00:07:39,858
That is now changed.

142
00:07:41,763 --> 00:07:45,251
And we are now using Cloudflare.

143
00:07:45,251 --> 00:07:50,163
Let's go back to the Cloudflare
site and press Continue.

144
00:07:50,163 --> 00:07:52,682
And that's us and done.

145
00:07:52,682 --> 00:07:54,947
We can press Recheck Name Servers here

146
00:07:54,947 --> 00:07:58,248
and make sure that Cloudflare knows

147
00:07:58,248 --> 00:08:00,259
that we have changed the name servers

148
00:08:00,259 --> 00:08:03,413
but name server changes can take awhile.

149
00:08:03,413 --> 00:08:04,944
Here is says up to 24 hours,

150
00:08:04,944 --> 00:08:06,722
other sites say 48 hours.

151
00:08:06,722 --> 00:08:09,181
It can take awhile to propagate across

152
00:08:09,181 --> 00:08:11,016
the domain name system.

153
00:08:11,016 --> 00:08:15,183
So give it a wee while until
that is all cleared out.

154
00:08:16,690 --> 00:08:18,199
In the next video we're going to look

155
00:08:18,199 --> 00:08:21,032
at, exactly, how DNS works and why

156
00:08:21,954 --> 00:08:23,867
changing these servers is important.

157
00:08:23,867 --> 00:08:26,023
So I'll see you in the very next video.

