Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Redirecting to holding page via name servers

Discussion in 'Domain Parking - General' started by simonb, Apr 29, 2012.

Thread Status:
Not open for further replies.
  1. simonb

    simonb Active Member

    Joined:
    Feb 2006
    Posts:
    121
    Likes Received:
    4
    Sorry if this has been covered before but I have a bunch of domains i'd like all redirecting to a holding page "this domain may be for sale" and I want to do it via the nameserver entry. I've had a quick look and can't seem to work out how to do it.

    I presume I need to set up my own nameserver but is there a service that can be bought that just redirects all requests to an ip?
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    IWA Meetup
     
  3. Edwin

    Edwin Well-Known Member

    Joined:
    Apr 2005
    Posts:
    9,851
    Likes Received:
    617
    Have a chat to the folk at http://www.zerigo.com/ - they put together a custom deal for us based on having a large volume of domains but a (relatively) small number of DNS lookups on each one.

    If you then host a website with a dedicated IP, you can get things set up so that all domains get redirected to that IP via the nameserver settings.
     
  4. tifosi United Kingdom

    tifosi Well-Known Member

    Joined:
    Oct 2004
    Posts:
    3,414
    Likes Received:
    55
    Nameservers are only one part of the equation. It just tells the domain which server to point the domains to. You don't 'need' your own nameserver to do that.

    The hard work is what to do after it gets to the server. To do it the way I've done below will need root access i.e. vps or dedi server.

    I've done it by creating a 'master' domain account on the server - just a normal domain account through cpanel for domain x.co.uk which has the home file system /home/x & web root /home/x/www. Create a directory in the web root e.g. /home/x/www/z

    Then through cpanel go to dns functions and create a dns record for domains a b c etc using the primary ip of the server. This creates the dns zone files for the domains.

    Then via SSH log into your server and go to your apache config directory and in the includes folder find the post_virtualhost_global.conf file. Inside that create a virtual host record for each additional domain... e.g. where xxx is your servers ip

    <VirtualHost XXX.XXX.XXX.XXX:80>
    ServerName a.co.uk
    ServerAlias www.a.co.uk
    DocumentRoot /home/x/public_html/z/
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/a.co.uk combined
    CustomLog /usr/local/apache/domlogs/a.co.uk-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    </VirtualHost>

    Save and restart the web server (i.e. apache if your using that).

    The domains a b c if they have the namervers set up to point to the server will then redirect to the /z directory. But will show the correct domain in the url. You're effectively piggy backing the x.co.uk domains file system.

    I've then created a db driven holding page which takes the referring domain i.e. a b c, strips out the domain name, gets some info for the domain e.g. price, status, ads and generated the page.

    Of course you could create an account per domain in cpanel and just use the same script, but if you have xxx domains and a cpanel/plesk limited licence this isn't possible. This way you just use one account.

    In theory you don't need the primary account, just a directory set up on the server which is web accessible. I've just used the x.co.uk for simplicity and as a potential redirect if needed. You could - which I've done - set up multiple directories e.g /a /b/ /c to use for different categories or groups.

    S
     
  5. AssetDomains

    AssetDomains Well-Known Member

    Joined:
    Feb 2010
    Posts:
    3,062
    Likes Received:
    76
    I use the Parked Domains feature of cpanel at my host to do this everything points to the same folder and I have some PHP that works out the domain the visitor entered on and looks up some stats from a csv file.
    Example cheap car insurance

    I had to add each name manually I don't have that many. Depending on how many domains you have this could be quite a tedious process.
     
    Last edited: Apr 29, 2012
  6. simonb

    simonb Active Member

    Joined:
    Feb 2006
    Posts:
    121
    Likes Received:
    4
    Thanks for the comments guys. It's appreciated. I'm looking into them now (although i use windows servers not linux).
     
Thread Status:
Not open for further replies.