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.

Redirecting all subdomains to a certain IP

Discussion in 'General Discussion' started by AndyB78, Nov 20, 2009.

  1. AndyB78

    AndyB78 Active Member

    Joined:
    Oct 7, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Romania
    Hello,

    I was wondering if I can set things up so that all subdomains for a specific domain would be redirected to another IP.

    I believe I have to make some setings in the DNS zone (like "* 14400 IN A new_ip") plus some settings in httpd.conf.

    Can someone help me with the specific steps?

    Thanks and regards!
     
  2. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    * is normally used for setting. wild card DNS. This means that if somebody tries to access a non-existent subdomain on that domain, then also they will be re-directed to that IP. Are you sure you want to do this? Else, manually editing the DNS zone and pointing individual sub-domain A record to that IP would be a better idea.
     
  3. AndyB78

    AndyB78 Active Member

    Joined:
    Oct 7, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Romania
    Well the customer has requested this so I suppose this is what I should do. Besides the DNS zone should I change anything else?

    But more important: in the DNS zone would the wildcard "overwrite" all other records like the mail. CNAME etc?

    Regards!
     
    #3 AndyB78, Nov 21, 2009
    Last edited: Nov 21, 2009
  4. mickbeng

    mickbeng Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Penang, Malaysia
    wildcard DNS record should not be able to overwrite the other record existed from your database records.

    I believe that it is hard to done this except you could make the subdomain would not create the DNS entry.:D
     
  5. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    CNAME and MX records won't be effected. If you want to change the A record of the selected sub-domains, you need to set them in the DNS zone of the domain. If you wish to set the wildcard entry, you need to set them in the DNS zone as well as in the VirtualHost of the domain.

    DNS Zone:
    * IN A WhateverIP

    VirtualHost entry:
    ServerAlias *.yourdomain.tld
     
  6. mickbeng

    mickbeng Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Penang, Malaysia
    You should run this if you manually change the VirtualHost entry.
    /usr/local/cpanel/bin/apache_conf_distiller --update
     
Loading...

Share This Page