First of all hello to the community.
I'm not able to set hostname if i connect my network to dhcp.
But if i disabled the network provided by dhcp my hostname i already set is appear normally.
After test one by one i can confirm that Hostname always change to dhcppc* (and the * is the last ip provide by dhcp server).
CentOS 7
I hope i got a better answer or any explaination.
[Solved] Hostname automatic set when using dhcp
[Solved] Hostname automatic set when using dhcp
Last edited by vibol on 2017/05/10 10:07:30, edited 1 time in total.
Re: Hostname automatic set when using dhcp
The problem is that your DNS works correctly and your admin has defined reverse records there for all the DHCP controlled ip addresses. When your system gets assigned its new ip address, it does a reverse lookup, finds it has a hostname in DNS and sets your machine name to that.
You could try adding DHCP_HOSTNAME=yourwantedhostname to the ifcfg file.
You could try adding DHCP_HOSTNAME=yourwantedhostname to the ifcfg file.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Hostname automatic set when using dhcp
@TrevorH
Already set DHCP_HOSTNAME=myhostname.local in /etc/sysconfig/network-scripts/ifcfg-eth0 the ethernet with a dhcp ip.
Still the same issue.. I almost try everything follow by other result in google search include serverfault, centos forums, other howto's blog with how to change hostname but i can't get it to work.
And i hope open my new threat is a bit better resolution.
Already set DHCP_HOSTNAME=myhostname.local in /etc/sysconfig/network-scripts/ifcfg-eth0 the ethernet with a dhcp ip.
Still the same issue.. I almost try everything follow by other result in google search include serverfault, centos forums, other howto's blog with how to change hostname but i can't get it to work.
And i hope open my new threat is a bit better resolution.
Re: Hostname automatic set when using dhcp
Your name isn't really your concern. Your name is used by others to contact you, and they simply use the name to get your IP address from DNS server. Therefore, the others must refer to you by whatever name(s) is known to the DNS. In other words, it is the DNS data that you should update, not the local configuration. More than one name can resolve to same IP, it is just a matter of DNS setup.
That being said, there is command 'hostnamectl' to adjust local name:
https://access.redhat.com/documentation ... mectl.html
https://www.cyberciti.biz/faq/rhel-redh ... e-command/
The important point (mentioned in RHEL 7.3 release notes):
Is it the static, transient, or pretty name that you want to set?
That being said, there is command 'hostnamectl' to adjust local name:
https://access.redhat.com/documentation ... mectl.html
https://www.cyberciti.biz/faq/rhel-redh ... e-command/
The important point (mentioned in RHEL 7.3 release notes):
If using NetworkManager, there are three properties of interest in the configuration of a connection: ipv4.dhcp-send-hostname, ipv4.dhcp-hostname, ipv4.dhcp-fqdn.manual modifications done to the /etc/hostname file are no longer picked up automatically by NetworkManager; users should change the system host name through the hostnamectl utility. Also, the use of the HOSTNAME variable in the /etc/sysconfig/network file is now deprecated. (BZ#1367916)
Some DHCP servers use ...=== [dhcp-send-hostname] ===
[NM property description]
If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.
Is it the static, transient, or pretty name that you want to set?
Re: Hostname automatic set when using dhcp
Thank you! refer to the document provided by @jlehtone already know that my dhcp ready list my hostname so and when i start my next computer ti use this hostname it will return back to the dafault one.
So this is mistake by me. Everything Ok after i set hostname to another one.
[Solved]
So this is mistake by me. Everything Ok after i set hostname to another one.
[Solved]