Enable ML2 DNSΒΆ

Instruction to enable ML2 DNS on an OpenStack cluster. This will enable a resolver on the internal network, and instances will be resolved with their hostname.

First of all, configure neutron-api as follows:

juju config neutron-api enable-ml2-dns=true dns-domain=garr.cloud.na.

On your private network(s) add the IP address of the DHCP server among the DNS resolvers.

To look for DHCP server IP addresses:

openstack port list --long --network $MY_NETWORK | grep dhcp

Take note of the IP addresses shown.

Now add the DHCP server IP addresses to the subnet, either on the dashboard or with these commands:

openstack subnet set --no-dns-nameserver  $MY_SUBNET

openstack subnet set --dns-nameserver DHCP_IP_1 --dns-nameserver DHCP_IP_2 ... --dns-nameservers IP_EXTERNAL_RESOLVER $MY_SUBNET

Now boot a couple VMs attached to $MY_NETWORK, log in to the first one and try to look up to the second one:

$ nslookup $HOSTNAME_VM_2 [$DHCP_IP_1]

N.B. On Ubuntu 18+ instances it is necessary to specify the DHCP_IP nameserver.

To look for the internal nameserver on Ubuntu18+ instances:

systemd-resolve --status and look for "DNS Servers"