On Fri, Feb 23, 2018 at 04:09:07AM -0000, Andres Rodriguez wrote:
> On Thu, Feb 22, 2018 at 10:30 PM Scott Moser <ssmoser2+ubu...@gmail.com>
> wrote:

> > Getting this fixed in cloud-init is tricky.
> > In ifupdown (/etc/network/interfaces) world, we just took the "global dns"
> > entries and put them on the loopback device (lo).  Since that device would
> > always be brought up, and never really brought down, it served its purpose.

> > That is what Ryan tried above, but it doesnt seem to work.  Even if it
> > *did* work, the solution would be systemd-networkd specific, and cloud-
> > init doesn't speak to systemd-networkd or systemd-resolved.  It speaks
> > to netplan.  So we would still need a way for cloud-init to tell netplan
> > to do this.

> > That leaves us with 2 not-so-great solutions in cloud-init only:
> > a.) blindly put global dns entries on *all* interfaces
> > b.) cloud-init search through the config and find the "right" interface to
> > put the global dns entry on.

> This is the same issue we are facing in MAAS. Unless a user specifies a
> specific set of dns servers on a subnet, which is not always the case, then
> MAAS doesn’t know which interface the dns servers belong to.

> I believe this is one of the reasons why the “global” config was used,
> because effectively, the DNS server doesn’t really “belong” to a specific
> interface.

> So we either sent it to all, interfaces or pick a “best” interface, which
> is not the best approach either.

> As per mpontillo’s config, this has the likelihood to break dns
> resolution.

> That said, maybe option 3 would be to put th dns on the interface which the
> default routes will be going through...

Yes, and option 3 was what I previously recommended when mpontillo raised
this issue in <https://bugs.launchpad.net/netplan/+bug/1664806>.

Given that cloud-init itself has some notion of a "global" DNS server in v1
yaml, I think its v2 yaml renderer should apply the same logic.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1750884

Title:
  [2.4, bionic] /etc/resolv.conf not configured correctly in Bionic,
  leads to no DNS resolution

Status in cloud-init:
  New
Status in MAAS:
  Triaged
Status in nplan package in Ubuntu:
  New
Status in systemd package in Ubuntu:
  New

Bug description:
  When deploying Bionic, /etc/resolv.conf is not configured correctly,
  which leads to no DNS resolution. In the output below, you will see
  that netplan config is correctly to the 10.90.90.1 nameserver, but in
  resolv.conf that's a local address.

  Resolv.conf should really be configured to use the provided DNS
  server(s). That said, despite that fact, DNS resolution doesn't work
  with the local address.

  Bionic
  ------

  ubuntu@node01:~$ cat /etc/netplan/50-cloud-init.yaml
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
      version: 2
      ethernets:
          enp0s25:
              match:
                  macaddress: b8:ae:ed:7d:17:d2
              mtu: 1500
              nameservers:
                  addresses:
                  - 10.90.90.1
                  search:
                  - maaslab
                  - maas
              set-name: enp0s25
      bridges:
          br0:
              addresses:
              - 10.90.90.3/24
              gateway4: 10.90.90.1
              interfaces:
              - enp0s25
              parameters:
                  forward-delay: 15
                  stp: false
  ubuntu@node01:~$ cat /etc/resolv.conf
  # This file is managed by man:systemd-resolved(8). Do not edit.
  #
  # 127.0.0.53 is the systemd-resolved stub resolver.
  # run "systemd-resolve --status" to see details about the actual nameservers.
  nameserver 127.0.0.53

  search maaslab maas
  ubuntu@node01:~$ ping google.com
  ping: google.com: Temporary failure in name resolution

  [...]

  ubuntu@node01:~$ sudo vim /etc/resolv.conf
  ubuntu@node01:~$ cat /etc/resolv.conf
  # This file is managed by man:systemd-resolved(8). Do not edit.
  #
  # 127.0.0.53 is the systemd-resolved stub resolver.
  # run "systemd-resolve --status" to see details about the actual nameservers.
  nameserver 10.90.90.1

  search maaslab maas
  ubuntu@node01:~$ ping google.com
  PING google.com (172.217.0.174) 56(84) bytes of data.
  64 bytes from mia09s16-in-f14.1e100.net (172.217.0.174): icmp_seq=1 ttl=52 
time=4.46 ms
  64 bytes from mia09s16-in-f14.1e100.net (172.217.0.174): icmp_seq=2 ttl=52 
time=4.38 ms

  =============================
  Xenial
  ==============================

  ubuntu@node05:~$ cat /etc/network/interfaces.d/50-cloud-init.cfg
  # This file is generated from information provided by
  # the datasource.  Changes to it will not persist across an instance.
  # To disable cloud-init's network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  auto lo
  iface lo inet loopback
      dns-nameservers 10.90.90.1
      dns-search maaslab maas

  auto enp0s25
  iface enp0s25 inet static
      address 10.90.90.162/24
      gateway 10.90.90.1
      mtu 1500
  ubuntu@node05:~$ cat /etc/resolv.conf
  # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
  nameserver 10.90.90.1
  search maaslab maas

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1750884/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to