Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Oct 2003
    Location
    Romania
    Posts
    25

    Default Redirecting all subdomains to a certain IP

    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. #2
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    * 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. #3
    Member
    Join Date
    Oct 2003
    Location
    Romania
    Posts
    25

    Default

    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!
    Last edited by AndyB78; 11-21-2009 at 03:32 AM.

  4. #4
    Member
    Join Date
    Oct 2006
    Location
    Penang, Malaysia
    Posts
    56

    Default

    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.

  5. #5
    Member
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    1,050

    Default

    Quote Originally Posted by AndyB78 View Post
    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!
    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. #6
    Member
    Join Date
    Oct 2006
    Location
    Penang, Malaysia
    Posts
    56

    Default

    Quote Originally Posted by madaboutlinux View Post
    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
    You should run this if you manually change the VirtualHost entry.
    /usr/local/cpanel/bin/apache_conf_distiller --update

Similar Threads & Tags
Similar threads

  1. subdomains redirecting when they shouldn't
    By swagger in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 03-10-2010, 12:14 PM
  2. Wildcard subdomains redirecting somewhere else
    By sevent in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-04-2010, 07:35 AM
  3. All subdomains are redirecting to main domain
    By Acerman in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-04-2008, 02:22 PM
  4. Subdomains not redirecting
    By dancehands in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 10-05-2005, 04:08 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube