Cant get entry in bind to work with domain.com instead of www.domain.com
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Re: Cant get entry in bind to work with domain.com instead of www.domain.com
Quote:
Originally posted by pxes351
@ NS ns.domain.com.
@ NS dns2.isp.com.
; Zone records
;
@ MX 10 mail.domain.com
@ MX 20 mail1.isp.com.
ns A 1.1.1.2
vpn A 1.1.1.4
www CNAME web2.domain2.om.
CNAME web2.domain2.com.
---------------------------------------------------------
CNAMEs are pointers, they should point directly to an A record. It's possible to set up a CNAME to a CNAME (to a CNAME...) to an A record, but you still have to have something pointing to an A record. You appear to have
defined hosts:
ns.domain.com
mail.domain.com
A records for ns (ns.domain.com) and vpn (will be vpn.domain.com)
CNAME for www that points to web2.domain2.com
a blank CNAME pointing to web2.domain2.com, if this works like A records then you have pointed domain.com to web2.domain2.com
To point to the domain2.com domain, you need another zonefile for domain2.com, either on another DNS server or in this implimentation of BIND.
Code:
NS ns.darin.com.
A 10.10.10.2
MX 10 mail.darin.com.
TXT "my DNS test"
workstation1 A 10.10.10.10
ftp CNAME darin.com.
mail CNAME darin.com.
ns CNAME darin.com.
www CNAME darin.com.
Despite the esoteric setup though, you have still pointed both domain.com and www.domain.com to web2.domain2.com so both should resolve to it. A ping test (or a dig query) should reveal the same IP address for web2.domain2.com, domain.com and www.domain.com.
If they all resolve to the same IP then you mave have missed a virtual host config on the webserver. Assuming it is Apache, it should look something like this:
Darin: thanks for your answer.
To clarify, yes i am trying to point so that those that surfs to domain.com or www.domain.com ends up at web2.domain.com which is a site outside my site, I believe that i have configured the zone correct but it doesnt seems to work... any ideas how i should do?
Re: Re: Cant get entry in bind to work with domain.com instead of www.domain.com
Quote:
Originally posted by pxes351
i am trying to point so that those that surfs to domain.com or www.domain.com ends up at web2.domain.com which is a site outside my site, I believe that i have configured the zone correct but it doesnt seems to work... any ideas how i should do?
Quote:
Originally posted by Darin
...Despite the esoteric setup though, you have still pointed both domain.com and www.domain.com to web2.domain2.com so both should resolve to it. A ping test (or a dig query) should reveal the same IP address for web2.domain2.com, domain.com and www.domain.com.
ping web2.domain2.com and record it's IP...
ping domain.com and verify that it has the same IP as web2...
ping www.domain.com and verify that it has the same IP as web2...
if they all resolve to the same IP address, then they should be pointing in the right direction and I'd verify that the webserver has the right virtual domain settings for both:
Quote:
...you mave have missed a virtual host config on the webserver. Assuming it is Apache, it should look something like this:
If they resolve to different IPs it may not be your DNS settings, whoever owns web2.domain2.com may have DNS resolve multiple IPs for load balancing, etc to their domain and so then you will resolve multiple IPs to your domains. This is why I suggested dig, if you do a dig query on each domain name then you should come up with an A record for web2.domain2.com as the result of all 3 queries along with the appropriate nameservers. Really, we can only guess what's going on since you haven't even mentioned whether all of the domain names resolve to the same IP or not.
Hi again, i have now looked over the zone again and it was a typo when i posted the thread.
If i ping web2.domain2.com it resolvs the ipadress correct but if i ping domain2.com it doesnt resolves anything.
A colleague have tried to do the same thing with an M$ DNS-server and succedded byt entering a blank A host to the ip-address....
I tried to do the same thing in bind but is doesnt work.
A 1.2.3..4
www CNAME web2.domain2.com.
I will try dig later to see if dig reveals anything.
You just need to add an A record for the domain name (see below). Also, CNAMES must point to an address record.
Code:
;############################################################
$TTL 1d
@ 7d IN SOA ns1.mydomain.com. (
netadmin.mydomain.com. ; Zone Contact
2005012701 ; Serial
1h ; Refresh
30m ; Retry
7d ; Expire
1h ) ; Negative Cache
;############################################################
; mydomain.com Nameserver Records (NS)
;############################################################
@ 7d IN NS ns1.mydomain.com.
;############################################################
; mydomain.com A (ADDRESS) and MX Records (MAIL EXCHANGER)
;############################################################
@ 1d IN A 192.168.9.4
@ 1d IN MX 0 smtp.mydomain.com.
; Web/Internet based records
www 1d IN A 192.168.9.4
www1 1d IN A 192.168.9.3
smtp 1d IN A 192.168.9.2
...and so on
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.