This question already has an answer here:
Whenever I do 'sudo' I get an error saying 'sudo: unable to resolve host HP-Pavilion'. I recently change my hostname to "HP-Pavilion". I wonder if I screw up something.
$ sudo mkdir SourceCodePro sudo: unable to resolve host HP-Pavilion [sudo] password for mike:
Thank you for your help.