The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wildcard DNS for *.tld

Discussion in 'Bind / DNS / Nameserver Issues' started by ÃђмёÐ † ŊΐτџŁ, Jun 24, 2009.

  1. ÃђмёÐ † ŊΐτџŁ

    Jun 24, 2009
    Likes Received:
    Trophy Points:

    I need a server's DNS set to catch all the domain send request to it, for an example:

    Someone try's to visit Example Web Page which NS are ...

    So, It show an website when the request is made, however there are no domain parked or hosted as in my cPanel.

    I have done it before with ServerAlias in httpd.conf like below :

    NameVirtualHost x.x.x.x:80
    <VirtualHost x.x.x.x:80>
    ServerAlias *.info *.org *.mobi *.us *.tel *.me *.de * *.eu *.asia *.cn *.name *.ag *.bz *.hn *.mn *.sc *.lc *.vc * * *.tv *.ca
    ServerAlias *.ws *.cc *.nu *.in * * * *.au
    DocumentRoot /home/myusername/public_html
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/ combined
    BytesLog /usr/local/apache/domlogs/
    ## User nitul # Needed for Cpanel::ApacheConf
    <IfModule !mod_disable_suexec.c>
    User example
    Group example
    UserDir enabled example


    However: It's not working anymore since we moved to cPanel from Plain Apache Configuration. I guess there are some config mismatching with cPanel and Apache.

    Anyone have Idea how to fix it ? I need to get that 4000+ domain's up and working ASAP :)

    Best wishes,
    Ahmed Nitul
  2. keddie

    keddie Well-Known Member

    Nov 17, 2007
    Likes Received:
    Trophy Points:
    I also need to implement a wildcard DNS setup on one of my Cpanel DNS's.

    Can anyone point me in the right direction?
  3. Spiral

    Spiral BANNED

    Jun 24, 2005
    Likes Received:
    Trophy Points:
    On the Apache configuration, you need to create an extra virtualhost
    container and set it up in one of the httpd.conf include files executed
    after the normal virtualhost configurations load.

    I see you listed a wildcard to every TLD but that is not necessary as
    you could just simply put a wildcard for the server name itself (*) and
    any web connections that are not by IP directly without resolution or
    resolving to any existing site on your server would trigger the wildcard
    site to display.

    The trick under cpanel is to use the include files because if you just
    simply add the wildcard DNS virtualhost to httpd.conf by itself, it
    will get overwritten quickly by Cpanel and removed again.

    Anyway ...

    Using a wildcard virtualhost is particularly useful for trapping domains
    that still resolve to your server's IP address even though you don't have
    any accounts setup for those domains specifically.

    You won't need to do anything in terms of DNS configuration for what
    you are asking but the same technique could be applied to allow for
    wildcard subdomains as long as the entry comes after your regular
    virtualhosts and before this full wildcard virtualhost entry. For those
    you would need to make a wildcard DNS update in the DNS of the
    domains but the principle is the same.

    Just for a side FYI on wildcard DNS since I mentioned it:
    *  IN  A  xx.xx.xx.xx
    On Apache (httpd.conf) configuration side:
    ServerName *
    ServerAlias *
    (Or 'subdomain.*' for wildcard subdomains as also mentioned)
    #3 Spiral, Jul 6, 2009
    Last edited: Jul 6, 2009
  4. camperjohn

    camperjohn Member

    Dec 12, 2007
    Likes Received:
    Trophy Points:
    Do you have more details instructions on how to do this?

    What does the wildcard virtualhost config look like? Where and how do I make the include file?

    I also have 4000 domains I need to park....

Share This Page