Short and clean question
We has domain
that can be resolved and accessed from internet as ip
. On host with that ip
we has NAT and virtual machines that hidden behind that NAT. How can we give access to that machines by subdomain names like ssh v1.domain
?
Full original question
The problem is that our servers is going to move from our local network to datacenter. So we need some method to access it and we want it in pretty format.
We have two servers (h1
- windows server 2012, h2
- centos 7) with virtual machines (v1
, v2
, ..), many services (does not matter), registered domain name domain
and one public ip (ip
).
Is it possible to set up DNS such as BIND on server h(x)
or v(x)
to provide access to machines and services in a way
ssh h1.domain
ping v2.domain
The situation as I see it. When I do ping v2.domain
from local computer. Local resolver will resolve name domain
to ip
by outer DNS server (for example it will be h2
). And my computer honestly ping h2
.
The presence of BIND DNS server on h2
will change nothing.
If I set on my local machine h2
as DNS server. It will be even worse because local resolver will get local ip like 192.168.1.2 that v2
got from DHCP on h2
.
So I got lost. Need help while servers still in local network and we can do any experiments on them.
address translation
has to follow some rules or routes. For example: there's NAT on host with outer ip and it receive connection to 192.168.1.2 We can configure to bind it to machine in sub networks. But how we achieve that? Second example: commandping v1.domain
on local computer before ping will resolvev1.domain
in outer ip of host with NAT and ping command will connect to it with the same ip... Or we need on every developer computer add default gateway to host ip and host resolution for subdomains?