Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th April 2009, 15:42
bob808 bob808 is offline
Junior Member
 
Join Date: Jan 2009
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default bind problem. domain.com doesn't resolve to domain.net

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

Code:
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

Code:
$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

Code:
$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.
Reply With Quote
Sponsored Links
  #2  
Old 27th April 2009, 18:37
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

It must be CNAME, not DNAME.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 28th April 2009, 15:50
bob808 bob808 is offline
Junior Member
 
Join Date: Jan 2009
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you sure? On some other forum someone said to me to put DNAME for a domain that I want to resolve to another domain. If i have example1.com and example2.com, how do I define both so each one ends up on the same page? Let's say I own yahoo.com ( ) and google, and I want when someone accesses www.google.com to automatically get on www.yahoo.com. How can I define that in bind without making 2 separate zone files with all the zone declarations (www,ftp,mail etc...) and redirect in index.html ?
Reply With Quote
  #4  
Old 29th April 2009, 11:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

There's a DNAME record indeed (http://www.informit.com/articles/article.aspx?p=19798 ), but I haven't worked with it so far.

I'd create a CNAME record:
Code:
www.google.com. CNAME www.yahoo.com.
and then add www.google.com as a ServerAlias to the www.yahoo.com vhost.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 29th April 2009, 12:07
tebokkel tebokkel is offline
Member
 
Join Date: Feb 2007
Location: The Netherlands
Posts: 96
Thanks: 0
Thanked 9 Times in 9 Posts
 
Default

I second the CNAME, but he want's a redirect, not an alias.

Have a look at:
http://httpd.apache.org/docs/2.2/mod....html#redirect

This way, the browser changes the address line.

Paul
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 12:20
BIND as secondary to Windows DNS? cwhitmore HOWTO-Related Questions 3 16th May 2008 23:26
BIND 9 and debian unkn0wn Server Operation 7 24th April 2006 15:22
Problem with BIND and ISPConfigs's DNS Manager Nejko Installation/Configuration 66 22nd April 2006 20:47
bind problem flourishing General 2 10th December 2005 13:06


All times are GMT +2. The time now is 14:39.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.