Relative paths switching back to IP

Hi, I have noticed a strange behaviour, my main site, ie: server domain, resolves properly, however, instead of displaying relative links as http://mymainsite.com/etc… , it displays http://IPADDRESS/etc… I thought it was a browser issue but I have tested it from different locations and browsers with the same results. Any ideas? Have I misconfigured DNS? The other domains are OK, it’s just the main domain.

Regards