On my Ubuntu 12.4 these work fine:
$ hostname
my-machine-XX
ping `hostname`
ping my-machine-xx (192.168.0.69) icmp_req=1 ttk=64 time=0.043 ms
But host and nslookup return the wrong IP address:
$ host my-machine-xx
my-machine-xx has address 198.105.244.23
my-machine-xx has address 198.105.254.23
Host my-machine-xx not found: 3(NXDOMAIN)
$ nslookup my-machine-xx
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: my-machine-xx
Address: 198.105.244.23
Name: my-machine-xx
Address: 198.105.254.23
I'd appreciate help on how to fix it. Thanks.