I was 'mocking' some RPMs as part of our upgrade process and kept on getting this error :
warning: Could not canonicalize hostname:
It was looked at and felt that it wasn't really relevant at the minute - my build machine is only doing test builds, not serious ones.
However, I was messing round with installing XFCE on my minimal build CentOS 6 box and it complained about the domain name - the IP is DHCP but the network setup is minimal.
I decided the quick hack was to add the host/domain to /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 builder.reetspetit.net builder
1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Voila ! The next make mockbuild I noticed no error, so it must just be a DNS lookup thing.
Hope that helps :-)