uname -n–> MYSUSE
hostname -a–>Name or service not known.
hostname -s–>Name or service not known.
hostname -d–>Name or service not known.
hostname -f–>Name or service not known.
hostname—>MYSUSE
Entry is not same in /etc/hosts.
It is : 127.0.0.1 localhost
It should be : 127.0.0.1 mybox.mydomain.com localhost.localdomain localhost
/etc/sysconfig/network/ifcfg-eth0 does not contain HOSTNAME or DHCP_HOSTNAME?
uname -n–> MYSUSE
hostname -a–>Name or service not known.
hostname -s–>Name or service not known.
hostname -d–>Name or service not known.
hostname -f–>Name or service not known.
hostname—>MYSUSE
Entry is not same in /etc/hosts.
It is : 127.0.0.1 localhost
It should be : 127.0.0.1 mybox.mydomain.com localhost.localdomain localhost
/etc/sysconfig/network/ifcfg-eth0 does not contain HOSTNAME or DHCP_HOSTNAME?
It is working for me. But it is the local router that provides DNS forwarding, and sometimes fakes DNS support for local hostnames. If I use a different DNS server (other than provided by the router), then I define hostnames for local systems in “/etc/hosts”. At present I am not doing that, because the router is handling it well.
In Yast Network Settings, Hostname/DNS tab, I do check the box “Assign Hostname to Loopback IP” and I uncheck the box “Change Hostname via DHCP”.
It depends on your router, and on what you mean by “works”.
I have not tried it with my present router. When used with my previous router, if I left that on then my computer would be renamed to what the router wanted to call it. I did not want that, which is why I always uncheck that box.
However, I think that “worked” with my previous router only when using “ifup” network settings. It never worked when using “NetworkManager”.
I mean by “Is it exepected behaviour for Change Hostname via DHCP not to work.” is for when you have DHCP setting “Change Hostname via DHCP” , /etc/hosts file does not get changed. and ping to local hostname get failed.
As I observed, ping to local host-names works only its entry present in /etc/hosts file.
I am not getting “its depends on your router”. which configurations i need to check in router. Can you please explain me ?
And is there any service on DNS server which maintain Hostname-IP (DHCP home network’s) mapping ?
The idea of change name via DHCP is really for a business workplace environment, where the local hostnames are assigned via the DHCP server. That alliows the network manager to set up all machines to have identical software, and take care of the naming at the level of the DHCP server. This is probably not what you want in a small home network.
I am not getting “its depends on your router”. which configurations i need to check in router. Can you please explain me ?
Again, in a business workplace environment, I would not expect the router to do anything except provide IP address, perhaps hostname, domain name, DNS server. In such an environment, the network manager would add entries to the company DNS server to take care of the name lookups for local systems.
Routers intended for small home networks try to fake some of this. For example, they expect the client computer (probably a Windows box) to identify its NETBIOS name, and they setup a fake DNS response for queries for that name. But small home routers vary in how much of this they implement. There often isn’t anything to configure on the router. It depends on the router design.
Or, to put it all differently, in a small home network one learns to put up with whatever works or doesn’t work. That costs a lot less than hiring a network administrator.
That’s correct. This option makes dhcpcd change host name; nothing more.
and ping to local hostname get failed.
Well, name-to-address resolution is independent from host name. Host name is simply string that is stored in kernel and which is retrieved by commands like “hostname”. If you want to also update /etc/hosts you can write/extend script that is called when DHCP client gets address and modify /etc/hosts accordingly.