Unable to resolve host <Raspberry Pi Host name>: Name or service not known

I have Raspberry Pi (model B plus v1.2) and configure as headless system with VNC. When I start the node red, I found this message as follow:

sudo: unable to resolve host RPiBPlusv12: Name or service not known

Please refer to attached photo for more detail.

I'm not sure about the message is an error or warning. But I can use Node Red as usual.

And the message is coming again if I use "sudo systemctl enable nodered.service" as follow:

Is it problem with that message?


If that is your hostname check that it exists in the /etc/hosts file. Usually it will have a line            RPiBPlusv12

Thank for fast response.
Yes; it has the line

2020-01-04 18_32_55-Pi_127 (RPiBPlusv12) - VNC Viewer

Sorry, my mistake to check the spelling, Now it's OK now.
I've renamed twice, it's not follow the last host name, I think


if in doubt, reboot and check it.

I recommend using sudo raspi-config to rename the pi as it needs changing in a few places and it makes sure that this is done consistently


Need to also "RFCs mandate that a hostname's labels may contain only the ASCII letters 'a' through 'z' (case-insensitive), the digits '0' through '9', and the hyphen.Hostname labels cannot begin or end with a hyphen."

So _ (underscores) are not allowed.

1 Like