https://www.blogger.com/blogger.gThis code snippet would give an alert of blogger.com
<script type="text/javascript">
var firstDot = window.location.hostname.indexOf('.');
var lastDot = window.location.hostname.lastIndexOf('.');
var tld = window.location.hostname.substring(lastDot);
var isSubdomain = firstDot < window.location.hostname.lastIndexOf(tld);
var domain;
if (isSubdomain) {
domain = window.location.hostname.substring(firstDot == -1 ? 0 : firstDot + 1);
}
else {
domain = window.location.hostname;
}
alert(domain);
</script>