1 00:00:06,559 --> 00:00:11,629 In this video I'll tell you about managing hostname for correct operations. It's important 2 00:00:11,629 --> 00:00:16,699 that Linux hosts have the right name set and also hostname resolution is required 3 00:00:16,699 --> 00:00:21,769 as often reversed host name lookups are performed in communication between hosts. 4 00:00:22,469 --> 00:00:26,359 I would say if ever you see that your system is slow in 5 00:00:26,359 --> 00:00:30,250 whatever it is doing on the network, check on your host name resolution. 6 00:00:31,129 --> 00:00:35,104 First step is to use hostnamectl to set the host name and 7 00:00:35,104 --> 00:00:39,079 configure the etc host file with the appropriate hostname lookup settings. 8 00:00:39,899 --> 00:00:46,590 And at the network level, hostname resolution is handled by DNS, which is Domain Name Services. 9 00:00:47,310 --> 00:00:54,240 DNS is typically taken care of by your network administrator, but as a Linux user 10 00:00:54,240 --> 00:01:01,170 you should know how to configure local hostname resolution using etchosts. Let's check it out. 11 00:01:03,020 --> 00:01:07,600 So what happens if I use hostname? Well, 12 00:01:07,600 --> 00:01:12,180 hostname is showing my hostname linfen.example.org and hostnamectl. 13 00:01:15,060 --> 00:01:21,126 Let's use tab completion that allows you to get information about your hostname. Use hostnamectl hostname if you 14 00:01:21,126 --> 00:01:27,193 want to change it. I already did that and I'm quite happy with it. So I'm just going 15 00:01:27,193 --> 00:01:33,260 to use hostnamectl status where we can see all the information obtained about my current host. 16 00:01:34,180 --> 00:01:38,069 In order to make sure that hostname resolution is set up 17 00:01:38,069 --> 00:01:41,959 correctly, use sudo vim on etchosts. What do we see? 18 00:01:42,379 --> 00:01:49,182 Well, we see localhost and if you want to add a remote host, the only thing you 19 00:01:49,182 --> 00:01:55,985 need to do is to find the IP address and add the host name ubuntu.example.org which is 20 00:01:55,984 --> 00:02:02,787 also known as Ubuntu. It's common that your host names have a long name, the fqdn, the 21 00:02:02,787 --> 00:02:09,590 fully qualified distinguished name, as well as a short name, Ubuntu in this case. 22 00:02:10,250 --> 00:02:17,189 And if everything went all right, well, then I should be able to ping Ubuntu and that's working. So we should be good here.