I tried changing my hostname from localhost.localdomain of fedora machine by giving the below command
hostnamectl set-hostname example.com --static
After that I did a network restart . But when I tried to ping the example.com it doesn't map to the local ipaddress of the machine. My PC is behind a router with private address 192.168.1.2.
I checked the /etc/hostname which is updated correctly but the /etc/hosts still has the below entry
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
How to change hostname so that it maps to local IP ?
P.S : I tried rebooting the machine but it didn't help.