hostname -f return unknown host

  • Posted on: 6 March 2014
  • By: oon

Some scripts in linux, getting hostname using command `hostname -f`. I have tried this command on CentOS Linux.

If you got the command return unknown host, please check this lists:

  • check your /etc/sysconfig/network file,
    find variable HOSTNAME and make sure it's declared on file.
  • check environment variable $HOSTNAME, and make sure it returns the hostname that you set.
  • check if your hostname already declared with IP Address on /etc/hosts

hope it helps!

[1]https://www.centos.org/forums/viewtopic.php?t=6737

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.