1 00:00:06,660 --> 00:00:10,620 - Another part of networking is the host identity. 2 00:00:10,620 --> 00:00:12,960 So, for correct operations, it's important that the 3 00:00:12,960 --> 00:00:15,450 Linux hosts have the right name set. 4 00:00:15,450 --> 00:00:19,203 Also, host name resolution is often a heart requirement. 5 00:00:20,190 --> 00:00:23,580 As often reversed host name lookups are performed 6 00:00:23,580 --> 00:00:26,070 in communication between hosts. 7 00:00:26,070 --> 00:00:29,820 The main command to manage hostnames is hostnamectl 8 00:00:29,820 --> 00:00:31,860 and you can configure the /et/hosts file with 9 00:00:31,860 --> 00:00:34,083 the appropriate hostname lookup settings. 10 00:00:35,010 --> 00:00:36,183 Let me demonstrate. 11 00:00:37,800 --> 00:00:40,269 So, to start it I'm using hostname, 12 00:00:40,269 --> 00:00:42,660 hostname is the old command. 13 00:00:42,660 --> 00:00:45,330 Hostnamectl is the new command 14 00:00:45,330 --> 00:00:49,080 and host main- hostnamectl status, for instance, 15 00:00:49,080 --> 00:00:53,550 is showing you the static hostname and so much more. 16 00:00:53,550 --> 00:00:57,600 So, the static hostname here seems to be just centos. 17 00:00:57,600 --> 00:01:00,270 Nice thing about hostnamectl is that it is also 18 00:01:00,270 --> 00:01:02,820 telling you information about the operating system 19 00:01:02,820 --> 00:01:04,653 and much more. 20 00:01:05,610 --> 00:01:10,323 Now, if you use sudo hostnamectl, 21 00:01:11,490 --> 00:01:14,340 then you can actually set the hostname. 22 00:01:14,340 --> 00:01:19,080 So, hostname centos.example.com. 23 00:01:19,080 --> 00:01:21,750 And now if I use hostnamectl status again, 24 00:01:21,750 --> 00:01:24,813 then we can see that this hostname has actually been set. 25 00:01:25,740 --> 00:01:26,573 It's up to you. 26 00:01:26,573 --> 00:01:30,150 If you use an FQDN, a Fully Qualified Domain Name. 27 00:01:30,150 --> 00:01:35,010 That includes DNS information as in hostname.example.com 28 00:01:35,010 --> 00:01:36,273 or a short hostname. 29 00:01:37,980 --> 00:01:40,950 Now, in order to enable hostname resolving 30 00:01:40,950 --> 00:01:44,010 there's a configuration file ITC hosts 31 00:01:44,010 --> 00:01:47,340 and I'm going to edit ITC hosts right now. 32 00:01:47,340 --> 00:01:50,040 You can see that by default it only has information 33 00:01:50,040 --> 00:01:51,480 about localhost. 34 00:01:51,480 --> 00:01:56,480 I am going to add 192, 168, 29, 141 35 00:01:56,670 --> 00:02:00,000 for my centos.example.com. 36 00:02:00,000 --> 00:02:03,735 That's the long name and I'm also including the short name, 37 00:02:03,735 --> 00:02:08,735 192, 168, 29, 142, for the ubuntu.example.com 38 00:02:11,010 --> 00:02:13,320 and the short name ubuntu. 39 00:02:13,320 --> 00:02:14,610 Now, what is the result? 40 00:02:14,610 --> 00:02:17,220 The result is at this point I can use utilities 41 00:02:17,220 --> 00:02:22,220 like ping to verify connectivity with my ubuntuhost. 42 00:02:22,410 --> 00:02:26,760 ITC host is convenient, it's for local hostname resolution. 43 00:02:26,760 --> 00:02:29,280 If you wanna be able to do hostname resolution 44 00:02:29,280 --> 00:02:33,030 on internet hosts, that is the system called DNS, 45 00:02:33,030 --> 00:02:35,790 but DNS is not something that we are going to configure 46 00:02:35,790 --> 00:02:36,783 in this course.