Repository navigation
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
VR
CLOUDSTACK VERSION
4.11.1
CONFIGURATION
Advanced networking, KVM
OS / ENVIRONMENT
CentOS Linux release 7.4.1708
SUMMARY
Guest vms do not get public dns servers (from zone "public dns" setting) in dhcp offer.
As result network gateway ip is only ip in resolv.conf file inside guest vm.
VPC restart with "Cleanup" does not help.
VR has dnsmasq as dns server, which resolvs guest vms hostnames, but not public domains.
if I try to check for example (from guest vm)
dig google.com @172.16.0.17
; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @172.16.0.17
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 17071
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;google.com. IN A
;; Query time: 0 msec
;; SERVER: 172.16.0.17#53(172.16.0.17)
;; WHEN: Thu Sep 20 17:33:50 CEST 2018
;; MSG SIZE rcvd: 28
As I understand, dnsmasq works on VR as dns resolver and dhcp server
from VR log:
Sep 20 15:28:32 dnsmasq-dhcp[22851]: DHCP, static leases only on 172.16.0.81, lease time 1h
Sep 20 15:28:32 dnsmasq-dhcp[22851]: DHCP, static leases only on 172.16.0.65, lease time 1h
Sep 20 15:28:32 dnsmasq-dhcp[22851]: DHCP, static leases only on 172.16.0.49, lease time 1h
Sep 20 15:28:32 dnsmasq-dhcp[22851]: DHCP, static leases only on 172.16.0.33, lease time 1h
Sep 20 15:28:32 dnsmasq-dhcp[22851]: DHCP, static leases only on 172.16.0.1, lease time 1h
Sep 20 15:28:32 dnsmasq-dhcp[22851]: DHCP, static leases only on 172.16.0.17, lease time 1h
Sep 20 15:28:32 dnsmasq[22851]: using local addresses only for domain cs16cloud.internal
Sep 20 15:28:32 dnsmasq[22851]: reading /etc/dnsmasq-resolv.conf
Sep 20 15:28:32 dnsmasq[22851]: using local addresses only for domain cs16cloud.internal
Sep 20 15:28:32 dnsmasq[22851]: ignoring nameserver x.x.x.x - local interface
Sep 20 15:28:32 dnsmasq[22851]: read /etc/hosts - 16 addresses
Sep 20 15:28:32 dnsmasq-dhcp[22851]: read /etc/dhcphosts.txt
Sep 20 15:28:32 dnsmasq[22851]: cannot read /etc/dhcpopts.txt: No such file or directory
In this case dns server x.x.x.x was ignored, because dns server ip x.x.x.x is on VR.
I can add another one dns server ip(which is not in CS public network) for zone "public dns" setting.
But such behavior change looks strange - DNS request goes now from vm to VR:dnsmasq and only then to DNS server. Before it was from vm to DNS server directly.
So every guest vm always will has only one dns from dhcp (VR router ip).
Because dnsmasq has it's own issues (multiple resolvers), now it's impossible to set different dns servers as public dns for zone (for example: 8.8.8.8 and local provider dns)
EXPECTED RESULTS
when zone setting "public DNS server" = x.x.x.x
lease {
interface "eth0";
fixed-address 172.16.0.23;
option subnet-mask 255.255.255.240;
option routers 172.16.0.17;
option dhcp-lease-time 2671200;
option dhcp-message-type 5;
-----> option domain-name-servers 172.16.0.17,x.x.x.x;
option dhcp-server-identifier 172.16.0.17;
option dhcp-renewal-time 1335600;
option broadcast-address 172.16.0.31;
option dhcp-rebinding-time 2337300;
option host-name "postfix-mail-vm1";
option domain-name "cs16cloud.internal";
renew 2 2018/10/02 15:34:36;
rebind 3 2018/10/17 05:30:25;
expire 0 2018/10/21 02:15:25;
}
ACTUAL RESULTS
lease {
interface "eth0";
fixed-address 172.16.0.23;
option subnet-mask 255.255.255.240;
option routers 172.16.0.17;
option dhcp-lease-time 2671200;
option dhcp-message-type 5;
-----> option domain-name-servers 172.16.0.17;
option dhcp-server-identifier 172.16.0.17;
option dhcp-renewal-time 1335600;
option broadcast-address 172.16.0.31;
option dhcp-rebinding-time 2337300;
option host-name "postfix-mail-vm1";
option domain-name "cs16cloud.internal";
renew 2 2018/10/02 15:34:36;
rebind 3 2018/10/17 05:30:25;
expire 0 2018/10/21 02:15:25;
}
Can't say exactly, but seems behavior changed in 4.11.1
In 4.11.0 guest vms received full dns list (gateway ip + list of zone public dns servers)
Activity
[-]VR dhcp dns server[/-][+]VR dhcp domain-name-servers[/+]yadvr commentedon Sep 21, 2018
dnsmasq and dns related code has n't changed between 4.11.0 and 4.11.1. I'll try to reproduce.
yadvr commentedon Oct 3, 2018
@izenk can you check again? I misunderstood, the guest VMs should query, by default, dns via the VR. The VR is supposed to be the source of truth for dns queries which is why guest VMs as part of dhcp response should only get VR as the dns IP. I'll close this ticket wrt 4.11.2.0, please reopen if you disagree.
izenk commentedon Oct 3, 2018
@rhtyd I can't say how it should be. I noticed that behavior has been changed...
For example, before upgrade I had such dhcp leases on vms:
now I have
So, from my point of view the behavior has been changed
yadvr commentedon Oct 3, 2018
Thanks for sharing @izenk, yes it's possible that we've fixed the issue. The current behaviour you're seeing with latest 4.11.1/2 is the expected/ideal behaviour. The dnsmasq service on the VR should act as forwarding dns/agent, so ideally we would only expect to see the VR IP in the
domain-name-serverslist.izenk commentedon Oct 3, 2018
@rhtyd thanks, now its clear.
but unfortunately dnsmasq has (multiple resolvers) bug
So, now only equivalent dns servers can be used in "ZONE public dns" settings
izenk commentedon Oct 25, 2018
@rhtyd
Looks like this behavior in 4.11.1 is inconsistent
I created another VPC and now vms get DHCP domain-name-servers with full list of dns servers specified in zone settings, like:
So, now I have to VPCs
In one vms get option domain-name-servers with gateway_ip as only dns,
in another vms get domain-name-servers gateway_ip and ips set in zone public dns settings.
I can't understand what it depends on?
yadvr commentedon Nov 12, 2018
it looks like how you may have setup your env, I could not reproduce. cc-ing for ideas - @PaulAngus @nvazquez @DaanHoogland @borisstoyanov