1

I host mainsite.com and othersite.net on a single Debian 8 server with nginx/1.6.2. Recently I discovered that Google indexed hostmaster.othersite.net and this subdomain shows full content of mainsite.com.

I see this subdomain as a SOA record pointing to hostmaster@othersite.net in DNS lookup tools but it's not in the hoster's control panel. Where can it be located and how can I remove this redirection?

DNS records:

CNAME | *.mainsite.com  | is an alias of mainsite.com.     | 1800
A     | mainsite.com    | directs to xx.xx.xx.xx           | 1800 
NS    | mainsite.com    | directs to ns1.digitalocean.com. | 1800 
NS    | mainsite.com    | directs to ns2.digitalocean.com. | 1800 
NS    | mainsite.com    | directs to ns3.digitalocean.com. | 1800 


CNAME | *.othersite.net | is an alias of othersite.net.    | 1800
A     | othersite.net   | directs to xx.xx.xx.xx           | 1800
NS    | othersite.net   | directs to ns3.digitalocean.com. | 1800
NS    | othersite.net   | directs to ns1.digitalocean.com. | 1800
NS    | othersite.net   | directs to ns2.digitalocean.com. | 1800

Simplified nginx.conf (only location and www redirects removed):

server {
        listen 443 ssl default_server;

        ssl_certificate /etc/letsencrypt/live/mainsite.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/mainsite.com/privkey.pem;

        server_name mainsite.com;
        root /home/mainsite/html;
}

server {
        listen 80;
        server_name mainsite.com;
        return 301 https://mainsite.com$request_uri;
}

server {
        listen 443 ssl;

        ssl_certificate /etc/letsencrypt/live/othersite.net/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/othersite.net/privkey.pem;

        server_name othersite.net;
        root /home/othersite/html;
}

server {
        listen 80;
        server_name othersite.net;
        return 301 https://othersite.net$request_uri;
}
  • 2
    SOA is not a redirection, it's a required field in DNS. It denotes an email address (using a . instead of an at), so hostmaster.othersite.net just means the DNS SOA has hostmaster@othersite.net as the contact for the zone. If you want 'hostmaster.othersite.net' to not resolve, you need to remove your wildcard. That's the point of a wildcard, resolve every name in the zone that isn't explicitly configured. – yoonix May 16 at 16:22
  • 1
    default_server is presumably making that server block the default for any hostname you don't explicitly list in a server_name field. Since you don't specify another server for hostmaster.othersite.net, it uses that one by default. – Barmar May 21 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.