You can use the macro {%RootDocument.AbsoluteURL|(identity)GlobalAdministrator%}. This will get the domain you have entered in the Sites application for the site. So if your Site has localhost in the site domain, it will return http://localhost/. If it has www.domain.com, it will return http://www.domain.com/