I checked my /etc/hosts file which looked OK as follows :
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
But if I tried to ping John-Xubuntu I got host not found.
/etc/hostname showed :
So their was another issue at play. After mulling it over a bit I realised that the change happened whilst I was messing about with domain logons. I must have changed something and not changed it back.
On (X)Ubuntu /etc/resolv.conf is now handled automatically by resolvconf so that was unlikely to be the issue.
Next I thought I would check /etc/nsswitch.conf This file determines where, and in what order, it looks up DNS queries. Sure enough, there was the problem. It had been renamed to nsswitch.conf.domain
I renamed it back to nsswitch.conf (after checking the contents !) and problem solved.......
Hope that helps someone !