1
00:00:06,519 --> 00:00:08,990
Let's talk about hostname
resolution a little bit more.

2
00:00:09,890 --> 00:00:14,589
So hostname resolution allows host names to be
matched to IP addresses and the other way around.

3
00:00:15,429 --> 00:00:19,070
And the local etc host file is
the primary solution as we have just seen.

4
00:00:20,030 --> 00:00:24,295
But you will normally also
use domain name system and

5
00:00:24,295 --> 00:00:28,560
these DNS name servers
are configured in etcresolve configuration.

6
00:00:29,370 --> 00:00:30,480
That's a
classical way.

7
00:00:31,190 --> 00:00:36,634
And in this classical way you would
use the etcnsswitch conf to identify the

8
00:00:36,634 --> 00:00:42,079
order. But there's a new kid
in town and that is systemd resolved.

9
00:00:42,630 --> 00:00:47,679
Systemdresolved is how it works on
Ubuntu. Let's talk about systemd Resolved.

10
00:00:48,280 --> 00:00:54,450
It's a component of systemd and it's responsible
for managing DNS name resolution. And it runs as

11
00:00:54,450 --> 00:01:00,620
a service that communicates with the network stack
and it makes sure that multiple DNS sources can

12
00:01:00,619 --> 00:01:06,789
be used and DNS DNS records are cached
as well. So it functions as a local DNS

13
00:01:06,789 --> 00:01:12,959
server. To speed up your networking, you can
check the current status of it using systemctl status

14
00:01:12,959 --> 00:01:19,129
on systemd resolve d and you can use
resolvectl status for information about current DNS configuration.

15
00:01:20,109 --> 00:01:25,990
And if ever you need to overwrite
the DNS configuration, you edit the file etc.

16
00:01:25,990 --> 00:01:31,870
Systemdresolved configuration and restart systemd resolve D.
Let's check out the systemd resolve D.

17
00:01:33,030 --> 00:01:37,539
Okay, so what
happens when I use

18
00:01:37,539 --> 00:01:42,049
sudo systemctl status
on systemd resolve d?

19
00:01:44,349 --> 00:01:49,093
Well, oh no, I can see that systemdresolve
d could not be found. This is one

20
00:01:49,093 --> 00:01:53,836
of these parts where the distributions are taking
a different road. So I'm going to open

21
00:01:53,836 --> 00:01:58,579
a new terminal, and in my new
terminal I'm going to SSH to Ubuntu.

22
00:02:05,239 --> 00:02:10,099
And on the
Ubuntu system I'm using

23
00:02:10,099 --> 00:02:14,960
sudo systemctl status
of systemd resolve d.

24
00:02:18,039 --> 00:02:21,740
And there we can see
that systemd resolve d is running.

25
00:02:22,389 --> 00:02:28,233
So how exactly does it work?
Well, we have the input file

26
00:02:28,233 --> 00:02:34,076
etc systemd resolved conf and in
etcsystemdresolved conf you will find the

27
00:02:34,076 --> 00:02:39,919
configuration. Oh no, I don't
have vim on Ubuntu. Help.

28
00:02:40,219 --> 00:02:46,750
Let's do a quick sudo apt install
vim because really, vim is my favorite editor.

29
00:02:49,599 --> 00:02:55,919
Try again. Here we can see what the systemd resolve
d looks like. Oh boy, that's a lot of configuration.

30
00:02:56,439 --> 00:03:03,045
If ever you need to put in
some additional configuration for DNS, you can put

31
00:03:03,045 --> 00:03:09,650
it right here. Probably the most important
thing for you to do is resolvectl status.

32
00:03:10,030 --> 00:03:14,324
That will show you the current
DNS configuration on link 2 we

33
00:03:14,324 --> 00:03:18,620
can see that the current DNS
server is set to 192.21682 9.2.

34
00:03:22,259 --> 00:03:27,714
That's the local host internal DNS
that is provided by systemdresolve D and

35
00:03:27,714 --> 00:03:33,169
it allows me to cache records
which will nicely speed up my connections.
