-: DNS and NTP Issues. 2 2
In this video, we're going to discuss how to troubleshoot DNS 3 3
and NTP issues. 4 4
First let's focus on DNS. 5 5
Remember, DNS is used to match the domain names 6 6
with the corresponding IP addresses 7 7
that are used by a server. 8 8
This allows us to use memorable domain names 9 9
while our computers can access the information 10 10
using those IP addresses. 11 11
If your network clients 12 12
are unable to resolve their domain names to IP addresses 13 13
such as figuring out that diontraining.com 14 14
is supposed to point to 45.79.184.180, for example, 15 15
then you most likely have a DNS issue. 16 16
So first you needed to determine 17 17
if the issue is occurring on a single network client, 18 18
or is it a larger wide-scale DNS issue 19 19
on your network? 20 20
If it's only affecting one client, 21 21
then it's most likely going to be an issue 22 22
with that client's TCP/IP settings. 23 23
By running the IP, ifconfig or ip commands, 24 24
you can determine the IP address of the assigned DNS server. 25 25
Once you have that IP, 26 26
you should verify connectivity between your client 27 27
and that DNS server. 28 28
If there's no connectivity between them, 29 29
then you need to troubleshoot the connection at layer one 30 30
layer two, or layer three of the OSI model 31 31
to fix this DNS issue, 32 32
because your client simply can't reach the DNS server. 33 33
If your client can reach the DNS server, 34 34
but there's still a DNS issue, 35 35
then you need to either flush the DNS cache on the client 36 36
or change the configuration to allow the client 37 37
to use a different DNS server. 38 38
Something like Google's DNS servers 39 39
located at 8.8.8.8 and 8.8.4.4. 40 40
On the other hand, 41 41
if a client doesn't seem to be having an issue 42 42
with their configuration, 43 43
it may be your DNS server itself 44 44
is not properly responding. 45 45
In this case, you're going to troubleshoot your DNS server. 46 46
Now, this is usually going to be an issue 47 47
specifically for people who run their own websites 48 48
and control their own DNS records. 49 49
In these cases, 50 50
you need to verify that your A records 51 51
and your CNAME records were properly created. 52 52
With an A record, 53 53
you need to ensure the domain name is typed in properly, 54 54
and the IP address has been entered correctly. 55 55
A simple typo on either of these two parts of the A record 56 56
will cause users to not be able to locate your servers 57 57
and they won't be able to access them 58 58
using your domain name. 59 59
For your CNAME or Canonical Name records, 60 60
you need to ensure that the domain name used 61 61
as the source and destination are both spelled properly, 62 62
otherwise, you can be redirecting users to the wrong server 63 63
or to someplace that doesn't exist. 64 64
To verify your ANAME and CNAME records, 65 65
you can use the nslookup command. 66 66
Another common issue at DNS records 67 67
is the Time to Live 68 68
or TTL might be set incorrectly. 69 69
If the Time to Live is set too high, 70 70
the old DNS records will remain cached 71 71
until the Time to Live expires. 72 72
So if you have a Time to Live of 86,400 seconds, 73 73
your DNS server records won't expire 74 74
or be refreshed by DNS cache 75 75
until at least one day has elapsed. 76 76
In general, I like to keep my Time to Live 77 77
on my DNS server records at a pretty short interval, 78 78
something like 300 seconds, 79 79
which is about five minutes. 80 80
This avoids any caching issues 81 81
if I'm making frequent changes to my networks 82 82
or my websites. 83 83
Now another issue with DNS that occurs 84 84
is one of high latency. 85 85
If your DNS records are hosted far away from your users, 86 86
that's going to take more time and more delay 87 87
for them to access those records 88 88
when they're looking up a particular domain. 89 89
This is known as DNS Latency. 90 90
To reduce DNS latency 91 91
and improve the overall network performance for your users, 92 92
you should use DNS servers 93 93
that are located closer to your users, 94 94
such as one that you host yourself 95 95
within your DMZ or screened subnet, 96 96
or one hosted by your internet service provider directly. 97 97
Next, we're going to discuss NTP 98 98
or the Network Time Protocol. 99 99
And there's some issues around this as well. 100 100
Remember, NTP is a protocol 101 101
that allows the synchronization of system clocks 102 102
between different layers of a hierarchal, 103 103
semi-layered system of time sources. 104 104
This is important 105 105
because many of our distributed applications, 106 106
such as network authentication, 107 107
they're going to rely on proper synchronization of time 108 108
between your client and a server, 109 109
and our networks use NTP to do all of that. 110 110
In general, issues with NTP 111 111
are caused by the NTP packets not being received. 112 112
NTP packets may not be processed, 113 113
or the NTP packets have errors or packet loss. 114 114
If the NTP packets are not being received, 115 115
this needs to be troubleshot 116 116
to determine the root cause. 117 117
You need to begin at the physical layer 118 118
and ensure your clients and servers are properly connected 119 119
and cabled to your network. 120 120
Then if the NTP server is on your Local Area Network, 121 121
you need to verify it's communicating 122 122
between the client and the server 123 123
using their MAC addresses properly. 124 124
If the NTP servers located outside the Local Area Network, 125 125
you need to verify that the client can communicate 126 126
to that server using layer three IP addresses 127 127
for that server. 128 128
Now in general, if NTP packets are not being received, 129 129
this is more of a general network communication issue 130 130
at layer one, layer two, layer three, 131 131
or possibly a DNS server issue, 132 132
if you're referring to that NTP server 133 133
using its domain name and not its IP address. 134 134
Now, if the NTP packets are being received, 135 135
but they're not being processed properly, 136 136
you need to look at the network client or the NTP server 137 137
to ensure they're operating the NTP service 138 138
to read and process those NTP packets 139 139
that are being sent and received by these devices. 140 140
If the NTP process or service 141 141
doesn't act on the NTP packets being received, 142 142
there's going to be network communication issues 143 143
with other services, things like HTTPS 144 144
and network authentication processes. 145 145
Now, if the NTP packets are processed, 146 146
but there's errors or packet loss in them, 147 147
there's going to be a loss of time synchronization 148 148
that can occur. 149 149
The loss of synchronization might occur 150 150
if dispersion or delayed value for server goes really high. 151 151
High values indicate that packets are taking way too long 152 152
to get to the client from the server 153 153
in reference to the root of the clock. 154 154
So the local machine cannot trust the accuracy of the time 155 155
present in the packet 156 156
because it doesn't know how long 157 157
it took the packet to get there. 158 158
If there's a saturated link 159 159
or buffering is occurring along the way, 160 160
the packets can get delayed 161 161
as they come to the NTP client. 162 162
Now, the timestamp contained within a subsequent NTP packet 163 163
can occasionally vary a lot 164 164
and the local client cannot really adjust for that variance. 165 165
So if you're seeing errors 166 166
or lost packets with NTP, 167 167
that's going to cause a lot of loss of synchronization for you. 168 168
And you need to ensure that there's no saturation 169 169
in your network connections 170 170
and that your network connectivity is adequate 171 171
to be able to send the NTP packets in a timely manner. 172 172
(gentle music)