bob808
26th April 2009, 15:42
Hello people,
I have domain.net but I recently bought domain.com and want a redirect to domain.net when accessed via www ftp or mail.
I wish that when I access www.domain.com the browser should instant redirect me to www.domain.net. I want www.domain.com to be an alias for www.domain.net . I managed to set this up by defining domain.com as a separate zone with it's own settings, then modified index.html to redirect to www.domain.net but I don't like that, doesn't seem proffesional enough :)
So I tried a DNAME setting but still doesnt' work. Can't seem to find www.domain.com online on any service.
I will post my config:
/etc/bind/named.conf
options {
pid-file "/var/run/bind/run/named.pid";
directory "/etc/bind";
auth-nxdomain no;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
zone "." {
type hint;
file "db.root";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "db.local";
};
zone "domain.com" {
type master;
file "pri.domain.com";
};
zone "domain.net" {
type master;
file "pri.domain.net";
};
//// MAKE MANUAL ENTRIES BELOW THIS LINE! ////
zone "zzz.yyy.xxx.89.in-addr.arpa" {
type master;
file "rev.yyy.xxx.89.in-addr.arpa";
};
/et/bind/pri.domain.net
$TTL 86400
@ IN SOA ns1.domain.net. administrator.domain.net. (
2009032501 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS ns1.domain.net. ; Inet Address of name server 1
NS ns2.domain.net. ; Inet Address of name server 2
;
MX 10 mail.domain.net.
domain.net. A 89.xxx.yyy.zzz
mail A 89.xxx.yyy.zzz
www A 89.xxx.yyy.zzz
ns1 A 89.xxx.yyy.zzz
ns2 A 89.xxx.yyy.zzz
ftp CNAME domain.net.
domain.net. TXT "v=spf1 a mx ptr ~all"
;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
/etc/bind/pri.domain.com
$TTL 86400
@ IN SOA ns1.domain.net. administrator.domain.net. (
2009032007 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS ns1.domain.net. ; Inet Address of name server 1
NS ns2.domain.net. ; Inet Address of name server 2
;
domain.com. DNAME domain.net.
;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
I also set up as name server ns1.domain.net for domain.com at the company from witch I bought the domains.
I have domain.net but I recently bought domain.com and want a redirect to domain.net when accessed via www ftp or mail.
I wish that when I access www.domain.com the browser should instant redirect me to www.domain.net. I want www.domain.com to be an alias for www.domain.net . I managed to set this up by defining domain.com as a separate zone with it's own settings, then modified index.html to redirect to www.domain.net but I don't like that, doesn't seem proffesional enough :)
So I tried a DNAME setting but still doesnt' work. Can't seem to find www.domain.com online on any service.
I will post my config:
/etc/bind/named.conf
options {
pid-file "/var/run/bind/run/named.pid";
directory "/etc/bind";
auth-nxdomain no;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
zone "." {
type hint;
file "db.root";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "db.local";
};
zone "domain.com" {
type master;
file "pri.domain.com";
};
zone "domain.net" {
type master;
file "pri.domain.net";
};
//// MAKE MANUAL ENTRIES BELOW THIS LINE! ////
zone "zzz.yyy.xxx.89.in-addr.arpa" {
type master;
file "rev.yyy.xxx.89.in-addr.arpa";
};
/et/bind/pri.domain.net
$TTL 86400
@ IN SOA ns1.domain.net. administrator.domain.net. (
2009032501 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS ns1.domain.net. ; Inet Address of name server 1
NS ns2.domain.net. ; Inet Address of name server 2
;
MX 10 mail.domain.net.
domain.net. A 89.xxx.yyy.zzz
mail A 89.xxx.yyy.zzz
www A 89.xxx.yyy.zzz
ns1 A 89.xxx.yyy.zzz
ns2 A 89.xxx.yyy.zzz
ftp CNAME domain.net.
domain.net. TXT "v=spf1 a mx ptr ~all"
;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
/etc/bind/pri.domain.com
$TTL 86400
@ IN SOA ns1.domain.net. administrator.domain.net. (
2009032007 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS ns1.domain.net. ; Inet Address of name server 1
NS ns2.domain.net. ; Inet Address of name server 2
;
domain.com. DNAME domain.net.
;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
I also set up as name server ns1.domain.net for domain.com at the company from witch I bought the domains.