Ask Your Question

instance hostname not getting resolved locally ?

asked 2016-08-03 06:13:26 -0500

unmeshdesale gravatar image

I am using liberty with neutron running on controller nodes in HA. Instance is properly getting private ip address and I am able to resolve from instance but when I try to resolve instance's hostname, I am getting below error.

Instance details

host-10-10-0-101:~ # nslookup host-10-10-0-101

** server can't find host-10-10-0-101: NXDOMAIN

host-10-10-0-101:~ # ping host-10-10-0-101
ping: unknown host host-10-10-0-101

host-10-10-0-101:~ # cat /etc/hosts localhost localhost
::1 localhost localhost ip6-localhost ip6-loopback

host-10-10-0-101:~ # cat /etc/resolv.conf

search openstacklocal

DNSMASQ running on controller node

nobody    37679      1  0 04:33 ?        00:00:00 dnsmasq --no-hosts --no-resolv --strict-order --except-interface=lo --pid-file=/var/lib/neutron/dhcp/8822445d-2185-4b7b-97bc-ee26318c71fa/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/8822445d-2185-4b7b-97bc-ee26318c71fa/host --addn-hosts=/var/lib/neutron/dhcp/8822445d-2185-4b7b-97bc-ee26318c71fa/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/8822445d-2185-4b7b-97bc-ee26318c71fa/opts --dhcp-leasefile=/var/lib/neutron/dhcp/8822445d-2185-4b7b-97bc-ee26318c71fa/leases --dhcp-match=set:ipxe,175 --bind-interfaces --interface=tap60be5562-46 --dhcp-range=set:tag0,,static,600s --dhcp-option-force=option:mtu,1416 --dhcp-lease-max=65536 --conf-file= --server= --server= --domain=openstacklocal

root@controller-01:~# cat /var/lib/neutron/dhcp/8822445d-2185-4b7b-97bc-ee26318c71fa/host

This instance doesn't have cloud-init thats why it gets hostname from dnsmasq generated by neutron. Instance should be able to resolve itself and ping itself using it's own hostname. This was working fine on nova-network. How does neutron handle DNS resolution of instance hostname specifically in this case instance has got the hostname generated by neutron?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-11-23 06:18:37 -0500

I have the same issue. It resolved only after the dnsmasq service restart.

Is there any way to resolve it without service restart ?

I used the internal dns dnsmasq but not external "Designate".

edit flag offensive delete link more

answered 2016-08-25 05:48:33 -0500

sunnyarora gravatar image

External "Designate" server is the solution you are looking for which you will need to combine with Neutron network.

The issue which you are facing of not resolveing the dns name, its root cause is the way internal Neutron DHCP implemented. Broadly speaking, Instance gets DHCP from the network node. There are different agents associated with Neutron like plugin agent, DHCP agent,l3 agent etc. These agents interact with the main neutron process through RPC (for ex RabbitMQ or Qpid) or through the standard Networking API.

For each network, there is dnsmasq instance which provides DHCP services and DNS services. The namespace is like qdhcp-<uuid>. That UUID is of the network.

What happens in the background : Whenver a port is created in Neutron server -> Neutron server notifies the DHCP Agent that new port has been created and that point DHCP agent requests via RPC channel for port information and from that information It Creates a file/data no.of files that dnsmasq uses to comeup with the DHCP allocation and DNS services for that port. The DHCP agent notifies dnsmasq that it needs to read that file/files. Then DHCP agent creates such hostname with mix of IP address like "Host-'I-P'".

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-08-03 06:13:26 -0500

Seen: 1,690 times

Last updated: Nov 23 '16