Split document.domain and discard the first part if there is 3 parts

* reformat into heredoc too