PDA

View Full Version : cname just directs to sharedip


giftsnake
4th February 2009, 04:05
creating a website on ispconfig (domain.com) creates A records for hostname www and a forwarding (edit: co-domain) without hostname.

i would like to create cnames, so that e.g. mail.domain.com gives the same result as www.domain.com gives. but: new cname, host 'mail' target 'www.domain.com' just shows up with the sharedip page.

the dns entry in wikipedia tells, that cname lookups will be solved to ips, but if a server uses namebased virtualhosts, the cname is looked up as hostname.

is it right that a cname directs to a different vhost than the target of the cname does? or is it just too simple for me to see?!

thanks!

falko
4th February 2009, 18:56
It might take up to 72 hours until DNS changes propagate, so you might have to wait a little bit longer.

BTW, you cannot use CNAMEs for MX record (I'm writing this because you made mail.domain.com a CNAME record).

giftsnake
4th February 2009, 20:34
does it take up to 72 if i set my bind9 as nameserver of my client? i thought a simple /etc/bind9 restart could solve it...

i wanted to create the cnames like done in the guide (http://www.howtoforge.com/ispconfig_dns_providerdomain_schlund) just for testing...

addressing mail.domain.com in the browser should direct me to www.domain.de, or is that wrong?

falko
5th February 2009, 21:57
i thought a simple /etc/bind9 restart could solve it...In this case this is true.

Can you post the zone file?

giftsnake
5th February 2009, 22:16
in named.conf, the zonefile is set by:
zone "domain.com" {
type master;
file "pri.domain.com";
};


the pri.domain.com file looks that way:

cat pri.domain.com
$TTL 86400
@ IN SOA server2.somedomain.com. admin.domain.com. (
2009020510 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS server2.somedomain.com. ; Inet Address of name server 1
NS server2.somedomain.com. ; Inet Address of name server 2
;

MX 10 server2.somedomain.com.

domain.com. A 192.168.178.4
www A 192.168.178.4

web CNAME domain.com.
mail CNAME www.domain.com.

domain.com. TXT "v=spf1 a mx ptr ~all"

;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;


looks all default to me :-/

falko
6th February 2009, 19:45
Looks ok. Can you post the vhost configuration?

giftsnake
6th February 2009, 20:18
cat /etc/apache2/vhosts/Vhosts_ispconfig.conf

###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 192.168.178.4:80
<VirtualHost 192.168.178.4:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot /var/www/sharedip
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</IfModule>
</VirtualHost>
#
#
######################################
# Vhost: www.domain.com:80
######################################
#
#
<VirtualHost 192.168.178.4:80>
ServerName www.domain.com:80
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/web15/web
ServerAlias domain.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ErrorLog /var/www/web15/log/error.log
Alias /error/ "/var/www/web15/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web15/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web15/user/$1/web/$3
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</IfModule>
</VirtualHost>
#
#

falko
7th February 2009, 17:28
You need to have mail.domain.com in the ServerAlias line of the vhost:
ServerAlias domain.com mail.domain.com
To do this, add a Co-Domain mail.domain.com to that web site in ISPConfig.

giftsnake
10th February 2009, 14:20
works. thanks!