0

So I have Ubuntu 14.04 VMs running in an OpenStack environmnet. The DNS machine has an external IP (10.14.6.3) and an internal IP (192.168.1.3). I have two other machines within the same project [h1] that has an external ip (10.14.6.4) and an internal IP (192.168.1.4) and [n1] that has an external ip (10.14.6.5) and internal IP (192.168.1.5).

h1 and n1 have the DNS Machine's IP set in their resolv.conf, and can resolve correctly.

I have also set my local machine (outside openstack) to use 10.14.6.3 as my DNS server.

In the DNS machines Bind db file, I have the following entries:

h1 IN A 192.168.1.4
h1 IN A 10.14.6.4
n1 IN A 192.168.1.5
n1 IN A 10.14.6.5

the pointer file has the following:

1 IN PTR h1.
2 IN PTR h1.
3 IN PTR n1.
4 IN PTR n1.

My local machine only can talk to the 10.14 subnet. I want h1 and n1 to resolve each other via the 192.168 subnet (not the 10.14).

Most of the time, this works fine. If I ping h1 from n1, it resolves as 192.168.1.4 If I ping h1 from my local machine, it resolves as 10.14.6.4

Occasionally however, if I ping from either machine, the other IP will be used. Sometimes my local machine resolves h1 to 192.168.1.4, which won't work.

My question is, is there a way to force a sequential resolution without using a local host file? I want the machines inside openstack to resolve each other via local IP 192.168.x.x And I want machines external to openstack to resolve the names via the machines external IPs 10.14.x.x

Ryan
  • 147
  • 6

1 Answers1

3

I'm not quite clear what you want, but multiple entries for the same resource record in a single zone such as:

h1 IN A 192.168.1.4
h1 IN A 10.14.6.4

is called round-robin DNS and the effect is exactly as you describe, sometimes when accessing host h1 ip-address 192.168.1.4 is used, another time 10.14.6.4

I want the machines inside openstack to resolve each other via local IP 192.168.x.x And I want machines external to openstack to resolve the names via the machines external IPs 10.14.x.x

You resolve that by either using split-horizon DNS, which allows the same hostname to be resolved differently depending where the DNS request originates from, or simply have a unique name for each ip-address, e.g. h1.int.example.com. and h1.ext.example.com..

HBruijn
  • 77,029
  • 24
  • 135
  • 201