Score:0

Netplan DNS not working

kh flag

I am trying to setup a bridge interface to use with KVM guests. I can successfully SSH to other computers on the same network. I can also ping 8.8.8.8 directly. However, when I try to ping google.com I get: ping: google.com: Name or service not known. So it seems like routing, etc. is working fine, but DNS is not. Any help would be greatly appreciated. Here is my current netplan config:

# This is the network config written by 'subiquity'
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: yes
  bridges:
    br0:
      interfaces: [enp2s0]
      addresses: [10.0.0.20/24]
      routes:
      - to: default
        via: 10.0.0.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
        search: []
      parameters:
        stp: false
        forward-delay: 0
      dhcp4: no

I don't see anything too interesting in sudo netplan --debug apply. Here is the output:

** (generate:7576): DEBUG: 16:06:02.092: starting new processing pass
** (generate:7576): DEBUG: 16:06:02.092: br0: adding new route
** (generate:7576): DEBUG: 16:06:02.092: We have some netdefs, pass them through a final round of validation
** (generate:7576): DEBUG: 16:06:02.092: enp2s0: setting default backend to 1
** (generate:7576): DEBUG: 16:06:02.092: Configuration is valid
** (generate:7576): DEBUG: 16:06:02.092: br0: setting default backend to 1
** (generate:7576): DEBUG: 16:06:02.092: Configuration is valid
** (generate:7576): DEBUG: 16:06:02.093: Generating output files..
** (generate:7576): DEBUG: 16:06:02.093: openvswitch: definition enp2s0 is not for us (backend 1)
** (generate:7576): DEBUG: 16:06:02.093: NetworkManager: definition enp2s0 is not for us (backend 1)
** (generate:7576): DEBUG: 16:06:02.093: openvswitch: definition br0 is not for us (backend 1)
** (generate:7576): DEBUG: 16:06:02.093: NetworkManager: definition br0 is not for us (backend 1)
(generate:7576): GLib-DEBUG: 16:06:02.093: posix_spawn avoided (fd close requested)
(generate:7576): GLib-DEBUG: 16:06:02.096: posix_spawn avoided (fd close requested)
DEBUG:netplan generated networkd configuration changed, reloading networkd
DEBUG:enp2s0 not found in {}
DEBUG:br0 not found in {}
DEBUG:Merged config:
network:
  bridges:
    br0:
      addresses:
      - 10.0.0.20/24
      dhcp4: false
      interfaces:
      - enp2s0
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search: []
      parameters:
        forward-delay: 0
        stp: false
      routes:
      - to: default
        via: 10.0.0.1
  ethernets:
    enp2s0:
      dhcp4: true
  renderer: networkd
  version: 2

DEBUG:no netplan generated NM configuration exists
DEBUG:enp2s0 not found in {}
DEBUG:br0 not found in {}
DEBUG:Merged config:
network:
  bridges:
    br0:
      addresses:
      - 10.0.0.20/24
      dhcp4: false
      interfaces:
      - enp2s0
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search: []
      parameters:
        forward-delay: 0
        stp: false
      routes:
      - to: default
        via: 10.0.0.1
  ethernets:
    enp2s0:
      dhcp4: true
  renderer: networkd
  version: 2

DEBUG:Link changes: {}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for enp2s0
DEBUG:netplan triggering .link rules for br0
DEBUG:netplan triggering .link rules for vnet0
** (process:7574): DEBUG: 16:06:02.790: starting new processing pass
** (process:7574): DEBUG: 16:06:02.790: br0: adding new route
** (process:7574): DEBUG: 16:06:02.790: We have some netdefs, pass them through a final round of validation
** (process:7574): DEBUG: 16:06:02.791: enp2s0: setting default backend to 1
** (process:7574): DEBUG: 16:06:02.791: Configuration is valid
** (process:7574): DEBUG: 16:06:02.791: br0: setting default backend to 1
** (process:7574): DEBUG: 16:06:02.791: Configuration is valid
DEBUG:enp2s0 not found in {}
DEBUG:br0 not found in {}
DEBUG:Merged config:
network:
  bridges:
    br0:
      addresses:
      - 10.0.0.20/24
      dhcp4: false
      interfaces:
      - enp2s0
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search: []
      parameters:
        forward-delay: 0
        stp: false
      routes:
      - to: default
        via: 10.0.0.1
  ethernets:
    enp2s0:
      dhcp4: true
  renderer: networkd
  version: 2
David avatar
cn flag
I read your error as ping is not found. Have you tried to ping any other site?
uz flag
Jos
Does `sudo netplan --debug apply` give you anything interesting?
DasPete avatar
kh flag
@David any time I try to ping a hostname I get the error. But if I ping the IP address directly ping works fine. This is why I'm thinking the issue is isolated to DNS.
DasPete avatar
kh flag
@Jos unfortunately no. `sudo netplan --debug apply` looks normal as far as I can tell. I'll add the output to my question.
Score:0
kh flag

Not sure if this is truly an answer, but I did manage to fix my problem so I'll at least close this out. This was a new server setup anyway, so I just re-installed Ubuntu and started from scratch and for some reason it's working now, so not sure what exactly I did to fix it. But for reference, here is the final netplan config that I ended up with:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp2s0:
      dhcp4: false
      dhcp6: false
  bridges:
    br0:
      interfaces: [enp2s0]
      addresses: [10.0.0.20/24]
      gateway4: 10.0.0.1
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
      parameters:
        stp: false
        forward-delay: 0
      dhcp4: no
      dhcp6: no
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.