Preventing wildcard DNS redirecting to "This IP is shared" page.

Discussion in 'General' started by TheFuzzy0ne, Aug 8, 2008.

  1. TheFuzzy0ne

    TheFuzzy0ne New Member

    Is it possible to have my server throw an error of some kind when "anyhost.mydomain.tld" is used? I'm using dyndns, and to my knowledge it needs to have wildcard DNS active for it to work(?), but now any domain name that's not been registered on my servers DNS redirects to the "This IP address is shared." page. Is there any way to stop this short of registering every imaginable co-domain? I'd like to avoid having to maintain an .htaccess file if at all possible.

    Sorry, about the title. I really can't think of a better one, but if anyone else can, please let me know.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    You get the shared-IP page because you don't have anyhost.mydomain.tld anywhere as ServerName or ServerAlias in your Vhosts_ispconfig.conf.
     
  3. TheFuzzy0ne

    TheFuzzy0ne New Member

    Exactly. But this only happens for any subdomains that aren't registered in my DNS. Obviously, I can put anyhost.mydomain.net into my DNS, but then any other sub domains that aren't registered. I can't add every single possibility to my DNS. For example:

    www.mydomain.tld resolves a site
    ww.mydomain.tld resolves the shared IP page.
    w.mydomain.tld resolves the shared IP page.
    anythingelse.mydomain.tld resolves the shared IP page.

    Do you see what I mean? What I'd like is for those domains to show the "Page cannot be displayed" page in the browser. Just like you get if you went to http://randomsubdomain.google.com.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Then you must remove the wildcard DNS record from your DNS server.
     
  5. TheFuzzy0ne

    TheFuzzy0ne New Member

    I don't think I can, as the domain name is a subdomain of a subdomain, so it won't work without wildcard DNS. It would be really great if we could specify a default site, so if the server is accessed through any unregistered subdomain name, or through the IP, PHP will use header() to forward the user to the specified site. This could also be done through meta-refresh. What do you think?
     

Share This Page