LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-02-2021, 06:39 PM   #1
stampede
LQ Newbie
 
Registered: Dec 2018
Posts: 18

Rep: Reputation: Disabled
Ubuntu hostname -i output


I'm working on some K8's training, and I built a pair of Ubuntu VM's in VMware. KDE Neon to be specific.

I noticed this interesting anomoly.

Master:
pch@master:~$ hostname -i
127.0.1.1
Worker:
pch@worker:~$ hostname -i
192.168.0.157 172.17.0.1 fe80::20c:29ff:feb1:9de8
I even set the IP static in the GUI and disabled IPV6 rebooted and checked again. Same output... Not sure what's setting the info in hostname -i.

How can I make sure the IP is properly set so that hostname -i sees the real thing?
 
Old 09-02-2021, 06:44 PM   #2
stampede
LQ Newbie
 
Registered: Dec 2018
Posts: 18

Original Poster
Rep: Reputation: Disabled
Found it!!
Bizarrely the two servers were reading their /etc/hosts information differently.

127.0.1.1 was labeled master under /etc/hosts.

I've cleaned up the /etc/hosts files and specified the local IP's on each DNS name and now hostname -i output works great.
 
  


Reply

Tags
hostname, network, ubuntu



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 = hostname -> HOSTNAME: command not found ? thomas2004ch Linux - Software 2 08-26-2013 08:25 PM
Hostname issue - showing "localhost" instead of actual hostname. ryes31 Linux - Server 9 12-12-2012 08:19 PM
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 09:36 PM
hostname vs. HOSTNAME ? sirius56 Linux - Newbie 2 02-16-2007 08:16 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

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

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