# Sudo: unable to resolve host ubuntu: Name or service not known

**URL:** <https://discourse.pi-hole.net/t/sudo-unable-to-resolve-host-ubuntu-name-or-service-not-known/41507>\
**Category:** docker\
**Created:** [December 11, 2020, 7:06pm UTC](https://discourse.pi-hole.net/t/sudo-unable-to-resolve-host-ubuntu-name-or-service-not-known/41507 "2020-12-11T19:06:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucianpacurar](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/l/b5ac83/32.png) [@lucianpacurar](https://discourse.pi-hole.net/u/lucianpacurar)\
**Post date:** [December 11, 2020, 7:06pm UTC](https://discourse.pi-hole.net/t/sudo-unable-to-resolve-host-ubuntu-name-or-service-not-known/41507/1 "2020-12-11T19:06:57Z")

</div>

Hello,

I installed PiHole in Docker on Ubuntu 20.04.1 on RPi4. I had to struggle with the DNS port conflict a little, and I used this post to fix it: [https://discourse.pi-hole.net/t/setup-on-pi-in-docker-bind-error/19137/5](https://discourse.pi-hole.net/t/setup-on-pi-in-docker-bind-error/19137/5)

Now everything is fine except that whenever I run sudo commands in the Ubuntu terminal I get: `sudo: unable to resolve host ubuntu: Name or service not known`

Any idea what did I do wrong? Thank you!

---

<div class="post-metadata">

**Author:** ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)\
**Post date:** [December 11, 2020, 7:33pm UTC](https://discourse.pi-hole.net/t/sudo-unable-to-resolve-host-ubuntu-name-or-service-not-known/41507/2 "2020-12-11T19:33:56Z")

</div>

You haven't done anything wrong.

Every time you run `sudo` there is a lookup to the sudoers configuration files. One thing you can do with sudoers is set per machine/host rules. Part of that process means that every `sudo` call looks up the hostname to see if you've been granted priv's on that host. DNS doesn't know who `ubuntu` is so it logs a warning. Doesn't affect anything, just clutters up logs.

Easy solution would be to tell the host who `ubuntu` is. Either a custom DNS entry or a change to `/etc/hosts`, but changing `/etc/hosts` will disappear when you start a new container.
