i have been running into this problem that makes me unable to use sudo for the past while on my raspberry pi 4 but when i look in the /etc/hosts folder i see this
192.168.0.22 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.0.22 hostname
and the /etc/hostname says hostname
by the way my host name is ------------ but i'll replace it with hostname