public function getTopLevelDomain()
    {
        if ($this->getIpAddress() !== null) {
            return '';
        }

        $host = rawurldecode($this->getHost());
        $tld = strrchr($host, '.');

        if ($tld === '.') {
            $host = substr($host, 0, -1);
            $tld = strrchr($host, '.');
        }

        return $tld === false ? $host : substr($tld, 1);
    }