Wildcard DNS for the absolute beginner.

Lugie

Registered
Dec 7, 2005
2
0
151
Hello, I am trying to figure out how to activate wildcard DNS on my server.

However, the only thing I have access to log into is WHM and SSH. In what manner do I go about editing the httpd.conf file? I have no idea how to access it on my server using these options.

I do not know how to use SSH at all, however I have a program if somebody can lead me thru step-by-step.
 

Lugie

Registered
Dec 7, 2005
2
0
151
Wildcard DNS allows *.domain.com to be resolved to any file you want - basically forwarding any subdomain that is nonexistant to any file/directory you determine.

I just need to know how to edit files through SSH: mainly the ones I need to edit for wildcard DNS. I've never used SSH and would enjoy a helping hand to get me started - or be pointed in the right direction to learn how to use it.
 

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,980
156
368
SLC
cPanel Access Level
DataCenter Provider
edit your zone file for the domain in question with *.domain.com A entry

nano /usr/local/apache/conf/httpd.conf

edit your virtual host container for the domain in question to look like this


cntrol w search for domain.com



<VirtualHost xxx.xx.xxx.xxx>
ServerAlias www.domain.com domain.com *domain.com
ServerAdmin [email protected]
DocumentRoot /home/user/public_html
BytesLog domlogs/domain.com-bytes_log
User user
Group user
ServerName www.domain.com

User user
Group user
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/
</VirtualHost>

Control x save

and restart apache
 
Last edited:

cemlouis

Member
Oct 27, 2005
16
0
151
dalem said:
edit your zone file for the domain in question with *.domain.com A entry

nano /usr/local/apache/conf/httpd.conf

edit your virtual host container for the domain in question to look like this


cntrol w search for domain.com



<VirtualHost xxx.xx.xxx.xxx>
ServerAlias www.domain.com domain.com *domain.com
ServerAdmin [email protected]
DocumentRoot /home/user/public_html
BytesLog domlogs/domain.com-bytes_log
User user
Group user
ServerName www.domain.com

User user
Group user
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/
</VirtualHost>

Control x save

and restart apache
Is this also for subdomains?
 

cemlouis

Member
Oct 27, 2005
16
0
151
bijo said:
Hello,

In the case of sub domain, You should keep the sub domain virtual host container, before the main domain. Otherwise sub domain wouldn't work.
I used the exact same modification for subdomains is it ok? Or does it need modifications?

Thank you,
Cem