Skip to content

VR dhcp domain-name-servers #2856

Closed
Closed

Description

@izenk
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

  1. changed the title [-]VR dhcp dns server[/-] [+]VR dhcp domain-name-servers[/+] on Sep 21, 2018
  2. yadvr commented on Sep 21, 2018

    @yadvr
    Member

    dnsmasq and dns related code has n't changed between 4.11.0 and 4.11.1. I'll try to reproduce.

  3. self-assigned this
    on Oct 2, 2018
  4. added this to the 4.11.2.0 milestone on Oct 3, 2018
  5. yadvr commented on Oct 3, 2018

    @yadvr
    Member

    @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.

  6. izenk commented on Oct 3, 2018

    @izenk
    Author

    @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:

    lease {
      interface "eth0";
      fixed-address 172.16.0.25;
      option subnet-mask 255.255.255.240;
      option routers 172.16.0.17;
      option dhcp-lease-time 2692800;
      option dhcp-message-type 5;
      option domain-name-servers 172.16.0.17,8.8.8.8; 10.9.x.x; <--------- 172.16.0.17 is gateway on VR, 8.8.8.8 and 10.9.x.x - is public dns ips which are set in ZONE settings: public dns1, public dns2
      option dhcp-server-identifier 172.16.0.17;
      option dhcp-renewal-time 1346400;
      option broadcast-address 172.16.0.31;
      option dhcp-rebinding-time 2356200;
      option host-name "front-web-vm1";
      option domain-name "cs16cloud.internal";
      renew 2 2018/08/14 02:14:34;
      rebind 0 2018/08/26 20:54:45;
      expire 4 2018/08/30 18:24:45;
    }
    

    now I have

    lease {
      interface "eth0";
      fixed-address 172.16.0.25;
      option subnet-mask 255.255.255.240;
      option routers 172.16.0.17;
      option dhcp-lease-time 2692800;
      option dhcp-message-type 5;
      option domain-name-servers 172.16.0.17<--------- only VR ip stayed
      option dhcp-server-identifier 172.16.0.17;
      option dhcp-renewal-time 1346400;
      option broadcast-address 172.16.0.31;
      option dhcp-rebinding-time 2356200;
      option host-name "front-web-vm1";
      option domain-name "cs16cloud.internal";
      renew 2 2018/08/14 02:14:34;
      rebind 0 2018/08/26 20:54:45;
      expire 4 2018/08/30 18:24:45;
    }
    

    So, from my point of view the behavior has been changed

  7. yadvr commented on Oct 3, 2018

    @yadvr
    Member

    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-servers list.

  8. izenk commented on Oct 3, 2018

    @izenk
    Author

    @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

  9. izenk commented on Oct 25, 2018

    @izenk
    Author

    @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:

    option domain-name-servers 172.16.16.65,10.9.a.b,10.9.c.d;
    

    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?

  10. yadvr commented on Nov 12, 2018

    @yadvr
    Member

    it looks like how you may have setup your env, I could not reproduce. cc-ing for ideas - @PaulAngus @nvazquez @DaanHoogland @borisstoyanov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions