2

I'm looking to host my main domain in Server1 eg: example.com.

And host all subdomain's in another server Server2. I will be creating subdomain's dynamically.

eg: dynamic_subdomain.example.com

I know how to handle dynamic subdomain's. I only want to know how to point main domain to Server1 and all subdomain's to Server2

I'm not able to understand how to point my A records to achieve this.

Host   Points To
www 23.229.190.135
@   23.239.28.64

Currently I'm not able to get to the Main-Domain/Server1

Domain:

raotechsolutions.com
Server1: 23.229.190.135
Server2: 23.239.28.64

CNAME:

    Host    Points To   
    *       @   
    cpanel  www 
    e       email.secureserver.net
    email   email.secureserver.net  
    ftp     @   
    imap    imap.secureserver.net
    mail    pop.secureserver.net    
    pda     mobilemail-v01.prod.mesa1.secureserver.net  
    pop     pop.secureserver.net    
    smtp    smtp.secureserver.net
    webdisk @   
    webdisk.admin   @   
    webmail webmail.secureserver.net
    whm     @   
Ashwin Yaprala
  • 131
  • 1
  • 7

2 Answers2

4

There's nothing wrong with your DNS:

[me@risby ~]$ dig www.raotechsolutions.com
[...]
;; QUESTION SECTION:
;www.raotechsolutions.com.      IN      A

;; ANSWER SECTION:
www.raotechsolutions.com. 570   IN      A       23.229.190.135

and

[me@risby ~]$ dig foo.raotechsolutions.com
[...]
;; QUESTION SECTION:
;foo.raotechsolutions.com.      IN      A

;; ANSWER SECTION:
foo.raotechsolutions.com. 3556  IN      CNAME   raotechsolutions.com.
raotechsolutions.com.   556     IN      A       23.239.28.64

You haven't told us what's exactly wrong when you try to access these sites, so it's hard to comment on that, particularly in the light of your assurance that nothing's wrong with your web server setup. When I point a browser at http://www.raotechsolutions.com, I get the error

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

To me, that looks an awful lot like web server misconfiguration. But you've assured us that it's fine, and since your question asks how to set up your DNS in a particular way, then I can tell you that you've managed to do so.

Edit: you've now raised an issue that wasn't in your original question. If you don't want raotechsolutions.com. to resolve to server 2, I'd advise you to stop publishing a record that does exactly that:

[me@risby ~]$ dig raotechsolutions.com
[...]
;; QUESTION SECTION:
;raotechsolutions.com.          IN      A

;; ANSWER SECTION:
raotechsolutions.com.   114     IN      A       23.239.28.64

If you stop that record, you'll also need to change the "catchall" record for subdomains from a CNAME to an A record that points to 23.239.28.64 as well, or all your subdomains will stop being redirected to server 2.

Edit 2: OK, I can see I'll have to do this step by step.

  1. Remove the A record @ 23.239.28.64 and the CNAME record * @.
  2. Insert A records @ 23.229.190.135, sub 23.239.28.64, and * 23.239.28.64
  3. Any other CNAME that currently points to @, change it to point to sub instead unless you want ftp, whm, etc. to point to server1, in which case leave them unchanged.
MadHatter
  • 79,770
  • 20
  • 184
  • 232
2

From you question i can see that you want to point all your any sub-doamin to other server or simply you want to point a wild card entry if your hosting provider go-daddy allowed it on there server.

Just make A record entry:

HOST                     POINTS TO                               
*.domainname.com          #.#.#.#  

This will do the thing for you

OR

Go Cpanel

Edit DNS Zone. Select the domain you wish to modify from the list of available websites.

Under Add New Entries Below this Line you should fill in the fields so that they look like:

*                       14400            IN                     A               1.2.3.4

where 1.2.3.4 is the IP of the account

OR

Enable wildcard subdomains is to directly edit the httpd.conf file. (For this you will need root access to the server hosting the account.)

Log in as root and open the httpd.conf file (usually this file is located in /etc/httpd/conf) with a text editor such as vim or nano. Then find the VirtualHost entry for the website. It should look like:

<VirtualHost *:80>
ServerAlias www.yourdomain.com
ServerAdmin webmaster@yourdomain.com
DocumentRoot /home/yourdoma/public_html/joe
ServerName yourdomain.com
User yourdoma
Group yourdoma
BytesLog /usr/local/apache/domlogs/yourdomain.com-bytes_log
CustomLog /usr/local/apache/domlogs/yourdomain.com combined
ScriptAlias /cgi-bin/ /home/yourdoma/public_html/joe/cgi-bin/
</VirtualHost>

The only modification you need to make is change:

ServerAlias www.yourdomain.com

to

ServerAlias *.yourdomain.com
TBI Infotech
  • 1,584
  • 10
  • 17