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 08-09-2017, 09:43 AM   #1
Leoncito
LQ Newbie
 
Registered: Jun 2015
Location: Perú, Ecuador, Germany
Distribution: Linux Mint 17.3 , CentOS 7, Ubuntu 16.04 LTS
Posts: 4

Rep: Reputation: Disabled
IPs- and FDQNs on localhost with subnets on MINT 17.3?


Hi,

I am searching how to setup certain IPs (IPv4) with two (or more) subnets on my localhost for testing and (still) not using virtual machines.
I have a Laptop which I am carrying around all the time traveling and I wonder how it is possible to set such an environment up for testing purposes; e.g. later a test and learning of a bacula, postfix, alfresco or a private CA-SSL, all based on the IPs and FDQNs.

I would like to set up a private subnet (class A).

I am still a bit confused how I map a domain on which IP and how I map two domains on one IP.

Could you suggest how I make it going?

Thank you.

Leoncito
 
Old 08-14-2017, 08:40 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: San Bernardino, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 261

Rep: Reputation: 52
Greetings,

It sounds like there is some confusion about IPs versus hosts (e.g. Fully-Qualified Domain Names).

IP addresses are what is assigned to a network interface to designate where the system is on the network and where to address it for connections. The FQDN is the product of DNS translating the IP address to a name that should be easier for folks to remember. The translation between the FQDN and the IP address is done by DNS, or you can use your system's "/etc/hosts" file to accomplish the same thing.

A base, default "/etc/hosts" file should look something like this:
Code:
# /etc/hosts: Local Host Database
#
# This file describes a number of aliases-to-address mappings for the for 
# local hosts that share this file.
#
# In the presence of the domain name service or NIS, this file may not be 
# consulted at all; see /etc/{host,nsswitch}.conf for the resolution order.
#

# IPv4 and IPv6 localhost aliases
127.0.0.1       localhost
::1             localhost

#
# Imaginary network.
#10.0.0.2               myname
#10.0.0.3               myfriend
#
# According to RFC 1918, you can use the following IP networks for private 
# nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
#
# In case you want to be able to connect directly to the Internet (i.e. not 
# behind a NAT, ADSL router, etc...), you need real official assigned 
# numbers.  Do not try to invent your own network numbers but instead get one 
# from your network provider (if any) or from your regional registry (ARIN, 
# APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
... and when you want to configure your system to know itself on it's "home" network, you change it to something like this (assuming the IP address on the home network is 192.168.1.101.):
Code:
#

# IPv4 and IPv6 localhost aliases
127.0.0.1       localhost
::1             localhost

192.168.1.101   mycomp.home-domain.com mycomp
Now, you are going to take your system into work and put it on the network there, which will assign it a 10.10.17.58 IP address, so now you should update your '/etc/hosts' file to look something like this:
Code:
#

# IPv4 and IPv6 localhost aliases
127.0.0.1       localhost
::1             localhost

192.168.1.101   mycomp.home-domain.com mycomp
10.10.17.58     mycomp.work-domain.com
You can read more about the "/etc/hosts" file at this LQ Wiki page.

HTH. Let us know.
 
Old 08-15-2017, 06:49 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Clearly cited examples:
in a terminal issue:
Code:
man hosts  | less -Ip '^EXAMPLE'
If "Fred" wants to call the mailserver "mailserver", fine, adjust Fred's /etc/hosts on his system
Code:
10.1.100.10    mailserver.domain.com       mailserver
If "Mike" wants to get to the mailserver using zimbrahost, adjust his Mike's /etc/hosts on his system
Code:
10.1.100.10    mailserver.domain.com      zimbrahost
The names are completely arbitrary.

Have fun!

Last edited by Habitual; 08-15-2017 at 06:51 AM.
 
Old 08-15-2017, 09:04 AM   #4
Leoncito
LQ Newbie
 
Registered: Jun 2015
Location: Perú, Ecuador, Germany
Distribution: Linux Mint 17.3 , CentOS 7, Ubuntu 16.04 LTS
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi,

thank you @shadowcat8 and @habitual! That helped me out at the current stage with my issue.

All the best

Leoncito
 
  


Reply

Tags
dns, ipv4, localhost, mapping, subnet



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
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1. fakie_flip Linux - Networking 2 06-08-2010 04:21 PM
Can I Ban Certain IPs or Subnets davidstvz Linux - Newbie 8 08-16-2008 09:34 AM
Getting things straight: Apache, SSL, Multiple External IPs / Internal IPs robin.com.au Linux - Server 21 10-13-2007 11:39 PM
Machines on different subnets / static IPs natv Linux - Networking 4 02-04-2007 02:34 PM
SSH localhost is fine, IPs won't connect zzero Linux - Networking 4 03-24-2004 01:00 PM

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

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