LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2013, 01:52 PM   #1
misterjones
LQ Newbie
 
Registered: Oct 2011
Posts: 10

Rep: Reputation: Disabled
hostname -f returns "localhost" instead of fqdn


I have a CentOS 6.4 machine I'm setting up for a piece of software I'm evaluating. Part of the install script invokes "hostname -f" and expects an fqnd returned and fails if it doesn't.

I have the following set up:

/etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.17.3.242 testbox.<myfqdn.com>

and /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=testbox
GATEWAY=172.17.3.254

nsswitch.conf is set to search files first, then dns and /etc/host is set for the same.

If I execute hostname -f, I get an error "Host name lookup failure". If I append the first line of /etc/hosts with testbox, I get "localhost" returned when I run the same command.

Any idea what I may be missing?
 
Old 06-07-2013, 07:29 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Could you please run these commands, and then post the output:

Code:
hostname
hostname -i
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname issue - showing "localhost" instead of actual hostname. ryes31 Linux - Server 9 12-12-2012 08:19 PM
Mandriva 2008 boot stalls on "setting hostname localhost:" on HPdv9700t cmack43 Linux - Laptop and Netbook 0 02-24-2008 07:00 PM
"hostname -i" returns 0.0.19.196 fivezerosixzero Linux - General 4 08-27-2004 09:01 PM
/var/log/messages contains "localhost" instead of the real hostname allel Linux - Networking 0 07-15-2002 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration