Score:0

using hostname instead of IP address in vpn

fi flag

I server noob here and I've a problem at my hand, I've a VPN and there are several VMs connected to it, each host a specific service. These services are running on a specific port (3000,8080). So when I want to access a service in my browser I go to 192.168.10.2:3000 or 192.168.10.3:8080. What i want to do is, instead of using the ip address of each machine I want to give each machine a hostname and use that name to access the services in my VPN. For example if I want to access my jenkins server I should be able access via 'jenkins.mynetwork.com' and not 192.168.10.2:8080. Any help how I can setup this will be really appreciated.

Score:0
th flag

Are you already aware of hosts file? If the hostnames only need to work on your own machine you could just use /etc/hosts (in Windows it would be C:\Windows\System32\Drivers\etc\hosts). Just create an entry per IP. You can specify different comma-separated names for the same IP. For example:

192.168.10.2 jenkins jenkins.mynetwork.com
192.168.10.3 other other.mynetwork.com

And in your browser either: http://jenkins:8080 or http://jenkins.mynetwork.com:8080

If this must also work for other colleagues you either install a local DNS (Pihole for example) or everyone has to update their hosts file.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.