LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 07-21-2017, 02:44 AM   #1
leniviy
Member
 
Registered: Jul 2009
Distribution: Archlinux
Posts: 69

Rep: Reputation: 4
Network is down, no /etc/hostid but hostid returns something. Why?


I have a VM with CentOS 6.8. The network cables are disconnected. There are no /etc/hostid or /var/adm/hostid, but the command returns a persistent non-zero value. I tried to change MAC addresses, but that did not have any effect.
 
Old 07-21-2017, 03:31 AM   #2
leniviy
Member
 
Registered: Jul 2009
Distribution: Archlinux
Posts: 69

Original Poster
Rep: Reputation: 4
Nevermind. hostname was localhost.localdomain so it was a resolvable ip.
 
Old 07-21-2017, 03:35 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,420

Rep: Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339
Your detail is scanty. You probably want $HOSTNAME, not hostid which returns a binary number. Networking is usually passed to the main box for a VM, and if you're doing anything else say exactly what you're doing.
How_To_Ask_a_Question
 
Old 07-21-2017, 06:07 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,769

Rep: Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933
The default hostid is typically a byte swap of the IP address that matches the hostname in the hosts file in hex format.

Since the default hostname is localhost.localdomain which is also the default alias assigned to your local loopback adapter i.e 127.0.0.1 the hostid is 007f0101.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hostid 00000000 Latman Linux - Newbie 3 06-26-2012 02:15 AM
hostid and virtualization Corrado Linux - Software 1 06-13-2008 05:14 PM
HostId nanlogan2 Linux - Software 1 10-23-2005 09:31 AM
hostid help bruse Linux - Networking 1 03-30-2005 01:53 AM
hostid in windows sodhilogin General 5 11-28-2004 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 03:29 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