Skip to main content
added 21 characters in body; edited title
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172

Why doesn't hostname'sdoes the hostname command's output differ from /etc/hosts?

[root@localhost ~]# hostname hello
[root@localhost ~]# hostname
hello
[root@localhost ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost ~]# 

The command line output is as above.

Why doesn't hostname'sis the hostname output differdifferent from what is found in /etc/hosts/etc/hosts?

Why doesn't hostname's output differ from /etc/hosts?

[root@localhost ~]# hostname hello
[root@localhost ~]# hostname
hello
[root@localhost ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost ~]# 

The command line output is as above.

Why doesn't hostname's output differ from /etc/hosts?

Why does the hostname command's output differ from /etc/hosts?

[root@localhost ~]# hostname hello
[root@localhost ~]# hostname
hello
[root@localhost ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost ~]# 

The command line output is as above.

Why is the hostname output different from what is found in /etc/hosts?

tags
Link
countermode
  • 7.8k
  • 5
  • 34
  • 59
Source Link
xmllmx
  • 1.9k
  • 5
  • 22
  • 30

Why doesn't hostname's output differ from /etc/hosts?

[root@localhost ~]# hostname hello
[root@localhost ~]# hostname
hello
[root@localhost ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost ~]# 

The command line output is as above.

Why doesn't hostname's output differ from /etc/hosts?