0

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.

Alan
  • 1

1 Answers1

0

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.

badc0de
  • 41
  • 2