top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Centos 6.4 hostname is not correct

+1 vote
311 views

I currently have a problem with hostname and fqdn.
I use:

# cat /etc/redhat-release ; uname -r
CentOS release 6.4 (Final)
2.6.32-358.11.1.el6.centos.plus.x86_64

# hostname
srv1.devel.test.com

# grep HOSTNAME /etc/sysconfig/network
HOSTNAME=srv1.devel.test.com

# cat /etc/hostname
srv1

# cat /etc/domainname
devel.test.com

but

# hostname --fqdn
devel.test.com

As I think it should give: srv1.devel.test.com. Have you got similar problem? Any hint how to solve it?

posted Jun 19, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

hostname's man page says:
"Technically: The FQDN is the name gethostbyname(2) returns for the host name returned by gethostname(2). The DNS domain name is the part after the first dot. Therefore it depends on the configuration (usually in /etc/host.conf) how you can change it. Usually (if the hosts file is parsed before DNS or NIS) you can change it in /etc/hosts."

So I would check your /etc/hosts.

answer Jun 19, 2013 by anonymous
Similar Questions
0 votes

On an old server (Dell PowerEdge SC1420, now without RAID) I have CentOS 6.4 installed, up, and running -- but it keeps failing to connect for some reason ....

NetworkManager applet 0.8.1 runs blue rings around in the panel for a while, then reports itself disconnected. It also offers a pseudo-choice, if I right-click, between Wired Connection and eth0; in fact, the cable to the router is the only connection the machine has or has ever had.

I've tried such things as I could find to get a connection, in vain. I've tried replacing the cable.

If there's a good fix, I'd like to get my wife running CentOS, because it's one obvious choice for her to have against such time as I'm gone. (I don't at all claim to be the Oldest Subscriber, but I am at an age such that I would be irrational not to plan for such contingencies.)

What new way can I try to get this beast online?

+1 vote

I changed the value in /etc/hostname but it did not see changes in my hostname. What could be the correct way to achieve this.

+1 vote

Can't get yumex or xfce on centos 6.4, any suggestions...

+2 votes

I've installed CentOS 6.4, for which Emacs 23 is available; but I'd like to have Emacs 24. I've looked at rpmforge and epel, but neither seem to have Emacs 24 already packaged; and I've searched for every combination of emacs + 24 + centos without success.

While I could, of course, just do the ./configure && make && make install dance, I don't like having software installed that's not in the packaging system. I'd appreciate any pointer to a prepackaged Emacs 24, or failing that, a good tutorial on how to package software correctly for CentOS.

0 votes

I need to create a real-time replication of a partition between two servers with centos 6.4, I am researching and finding difficulty with drbd, corosync, someone indicate material, do not need to run script automatically if a node drops only replicate.

...