Only changing the hostname, causes error to be shown on each sudo command to the terminal
–
Anwar ShahJul 6 '12 at 3:30

Thanks for noticing me about that , can you post the exact errors you see . According to Hostname man pageEdit /etc/hostname for permanent change, even i tried this method and haven't encountered any such errors.
–
atenzJul 6 '12 at 5:19

I edited /etc/hostname to a new name anwar from previous one anwar-precise. The error after rebooting the system and executing a sudo command is sudo: unable to resolve host anwar. It may be only warning. I executed sudo gedit command
–
Anwar ShahJul 6 '12 at 5:32

I searched for these and concluded you need to change both hosts and hostname to reflect complete changes , depending on maybe loopback , DNS , domain-name, resolv.conf. But its better to do changes in both of them. Yet i haven't encountered any such error ,must be different interface.
–
atenzJul 6 '12 at 6:00