Somewhat interestingly, I'm not sure why I can't just reproduce this by: $ sudo bash -c 'oname=$(hostname); trap "hostname $oname" EXIT; hostname my-bogus-hostname; hostname; time sudo /bin/true;' ; hostname
but it doesnt reproduce this way. -- 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/1730744 Title: sudo is slow (10 seconds) when hostname is not resolvable Status in systemd package in Ubuntu: New Bug description: I'm seeing very slow 'sudo' times in a qemu guest when the host uses systemd-resolved. If I change /etc/resolv.conf on the host to point directly to a dns server (8.8.8.8) then the problem goes away. To recreate, you can download a cloud image and boot it under qemu with a command line like: cloud-localds seed.img user-data meta-data qemu-system-x86_64 -enable-kvm \ -device virtio-net-pci,netdev=net00 \ -netdev type=user,id=net00 \ -drive file=root.img,id=disk00,if=none,index=0 \ -device virtio-blk,drive=disk00,serial=root.img \ -drive file=seed.img,id=disk01,if=none,index=1 \ -device virtio-blk,drive=disk01,serial=seed.img \ -m 768 Make sure that your hostname does not resolve (change it to 'bogus-host1'). Log into the guest and then just try sudo, you'll see something like: # time sudo ls sudo: unable to resolve host rooturl-trusty real 0m10.029s user 0m0.006s sys 0m0.011s To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1730744/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp

