I have this on Ubuntu 18.04. In my case I use dnsmasq with a custom
configuration providing DHCP and DNS to multiple bridges (Virtual
Machines and containers). So I need them both (in so far as I need
dnsmasq and am being forced to use systemd).

The problem is a DNS loop between systemd and dnsmasq. systemd-resolved
forwards DNS queries in parallel to entries in /etc/resolv.conf and
servers picked up from interfaces via DHCP. If you, like me have dnsmasq
in resolv.conf, and a dnsmasq configuration that forwards to systemd,
then you have a loop.

My work-around is to add `DNS=127.1.1.1` into
/etc/systemd/resolved.conf. Nothing is listening on 127.1.1.1 so the
queries go unanswered. The systemd resovler gets answers only from
servers provided to me via DHCP or statically assigned to an interface.

Inside my dnsmasq.conf I have `server=127.0.0.53`, and resolv.conf has
`nameserver 127.0.0.1` which is dnsmasq.

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

Title:
  systemd-resolved using 100% CPU

Status in dnsmasq package in Ubuntu:
  Confirmed
Status in systemd package in Ubuntu:
  Confirmed

Bug description:
  Sometimes systemd-resolved process is using 100% CPU.
  After a while it changes back to normal.

  It happens usually after connecting to the (wifi) network, like
  starting the OS.

  strace output:

  sendmsg(12, {msg_name(16)={sa_family=AF_INET, sin_port=htons(33589), 
sin_addr=inet_addr("127.0.0.1")}, 
msg_iov(1)=[{"6\215\201\200\0\1\0\1\0\0\0\1\4cs41\3wac\vedgecastcdn\3net\0\0\34\0\1\300\f\0\34\0\1\0\0\10\235\0\20&\6(\0\0024\0Y%L\4\6#f&\214\0\0)\377\326\0\0\0\0\0\0",
 81}], msg_controllen=28, [{cmsg_len=28, cmsg_level=SOL_IP, 
cmsg_type=IP_PKTINFO, {ipi_ifindex=if_nametoindex("lo"), 
ipi_spec_dst=inet_addr("127.0.0.53"), ipi_addr=inet_addr("127.0.0.53")}}], 
msg_flags=0}, 0) = 81
  sendmsg(3, {msg_name(0)=NULL, 
msg_iov(4)=[{"PRIORITY=6\nSYSLOG_FACILITY=3\nCODE_FILE=../src/resolve/resolved-dns-stub.c\nCODE_LINE=363\nCODE_FUNCTION=dns_stub_process_query\nSYSLOG_IDENTIFIER=systemd-resolved\n",
 160}, {"MESSAGE=", 8}, {"Processing query...", 19}, {"\n", 1}], 
msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 188
  epoll_wait(4, [{EPOLLIN, {u32=3176459184, u64=94565471415216}}], 16, -1) = 1
  clock_gettime(CLOCK_BOOTTIME, {44665, 938069872}) = 0
  recvfrom(12, NULL, 0, MSG_PEEK|MSG_TRUNC, NULL, NULL) = 53
  recvmsg(12, {msg_name(16)={sa_family=AF_INET, sin_port=htons(33589), 
sin_addr=inet_addr("127.0.0.1")}, 
msg_iov(1)=[{"Z\262\1\20\0\1\0\0\0\0\0\1\4cs41\3wac\vedgecastcdn\3net\0\0\34\0\1\0\0)\2\0\0\0\0\0\0\0",
 3936}], msg_controllen=56, [{cmsg_len=28, cmsg_level=SOL_IP, 
cmsg_type=IP_PKTINFO, {ipi_ifindex=if_nametoindex("lo"), 
ipi_spec_dst=inet_addr("127.0.0.53"), ipi_addr=inet_addr("127.0.0.53")}}, 
{cmsg_len=20, cmsg_level=SOL_IP, cmsg_type=IP_TTL, {ttl=64}}], msg_flags=0}, 0) 
= 53
  stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
  getrandom("\365I", 2, GRND_NONBLOCK)    = 2
  stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
  getrandom("\203;", 2, GRND_NONBLOCK)    = 2
  clock_gettime(CLOCK_BOOTTIME, {44665, 938446937}) = 0
  open("/run/systemd/netif/links/3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such 
file or directory)
  stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
  stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
  socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 18
  connect(18, {sa_family=AF_INET, sin_port=htons(53), 
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
  epoll_ctl(4, EPOLL_CTL_ADD, 18, {EPOLLIN, {u32=3176610576, 
u64=94565471566608}}) = 0
  write(18, 
"\203;\1\20\0\1\0\0\0\0\0\1\4cs41\3wac\vedgecastcdn\3net\0\0\34\0\1\0\0)\2\0\0\0\0\0\0\0",
 53) = 53
  clock_gettime(CLOCK_BOOTTIME, {44665, 938833717}) = 0
  clock_gettime(CLOCK_BOOTTIME, {44665, 938875138}) = 0
  epoll_ctl(4, EPOLL_CTL_DEL, 18, NULL)   = 0
  close(18)                               = 0

  journalctl output:

  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:35 parsec systemd-resolved[1512]: Processing query...
  Mar 08 08:25:41 parsec dnsmasq[1545]: Maximum number of concurrent DNS 
queries reached (max: 150)

  As you can see, I would use it together with dnsmasq.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.04
  Package: systemd 232-18ubuntu1
  ProcVersionSignature: Ubuntu 4.10.0-9.11-generic 4.10.0
  Uname: Linux 4.10.0-9-generic x86_64
  NonfreeKernelModules: zfs zunicode zavl zcommon znvpair
  ApportVersion: 2.20.4-0ubuntu2
  Architecture: amd64
  Date: Wed Mar  8 08:20:18 2017
  MachineType: Hewlett-Packard HP EliteBook Folio 1020 G1
  ProcEnviron:
   LANGUAGE=en_US:en
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/zsh
  ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-4.10.0-9-generic 
root=UUID=a54fe703-35d4-47ac-9c6e-4034421531fb ro rootflags=subvol=@
  SourcePackage: systemd
  UpgradeStatus: Upgraded to zesty on 2015-05-24 (653 days ago)
  dmi.bios.date: 03/09/2015
  dmi.bios.vendor: Hewlett-Packard
  dmi.bios.version: M77 Ver. 01.05
  dmi.board.name: 2271
  dmi.board.vendor: Hewlett-Packard
  dmi.board.version: KBC Version 91.4C
  dmi.chassis.asset.tag: CNU51199KV
  dmi.chassis.type: 10
  dmi.chassis.vendor: Hewlett-Packard
  dmi.modalias: 
dmi:bvnHewlett-Packard:bvrM77Ver.01.05:bd03/09/2015:svnHewlett-Packard:pnHPEliteBookFolio1020G1:pvrA3009DD18303:rvnHewlett-Packard:rn2271:rvrKBCVersion91.4C:cvnHewlett-Packard:ct10:cvr:
  dmi.product.name: HP EliteBook Folio 1020 G1
  dmi.product.version: A3009DD18303
  dmi.sys.vendor: Hewlett-Packard

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1670959/+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