Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-24-2016, 09:24 PM   #1
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
Learning Linux networking

Scenario on my laptop:
Initially created two VMs and gave them names: vm1 and vm2.
For KVM, it shows up as vm1.qcow2 and vm2.qcow2.
For VmWare, the files would be vm1.vmx and vm2.vmx

I can spin up both at same time and they each has IP like so: for vm1 for vm2

The IP addresses imply I have vm1 and vm2
on a local (private) network.

Now I want to give vm1 a name like and
vm2 a name like
So when accessing from vm1, I would do
something like this:
vm1 $ ssh

At this point there is no servers named and

If I want to access from my laptop,
I should set its IP address in /etc/hosts, e.g.

I want vm2 to be
So if I want to access from server vm1,
I add this line to file /etc/hosts on server vm1:

Now I can do this:
vm1 $ ssh
vm1 $ ping

And vm2 would respond to ssh and pinging, even though it does not know it is responding on behalf of

But at this point, there is no server name
vm2 instance does not know it is

So how do I “make” or “alias” vm2 instance to be self-ware that it is

Thank you.
Old 10-24-2016, 09:37 PM   #2
LQ Guru
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,790

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
You do not. Or rather, you can and likely will, but for networking purposes that is irrelevant. What you need to understand here is not networking directly (IPv4 in this case) but rather name resolution. Bind/dbs, host tables, resolv.conf, and perhaps arp would be excellent topics to consider as research topics for this study.

Nothing actually uses the FQDN (another term to look up) directly. It is always translated into some kind of IP address (generally IPv4 or IPv6 in the real world) and all networking traffic uses the IP address. Understanding something about how the FQDN gets translated to the IP address will make your entire understanding of the related topics expand.

Fun stuff!
1 members found this post helpful.
Old 10-27-2016, 12:19 PM   #3
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Answer to self:

Use hostnamectl to make your host's name permanent
and self-aware of its designated name.
Reboot to see permanent result.

To see host's name, use command:

To see host's short name:
>hostnamectl -s


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
LXer: Machine Learning, Deep Learning 101 LXer Syndicated Linux News 0 07-20-2016 11:00 AM
Coding bootcamp learning platform and privacy issues with online learning. Need Advice ! slothbin Programming 2 04-01-2016 08:33 AM
Learning Networking and Server basics Nabeel Linux - Server 2 11-27-2015 11:02 AM
Networking learning curve: No Reboot! parent's_basement Debian 17 11-19-2008 09:24 PM
Learning Networking DoubleLetter Linux - Networking 1 06-29-2003 04:18 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:58 PM.

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