Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
05-02-2005, 09:09 AM
|
#1
|
LQ Newbie
Registered: Sep 2003
Posts: 17
Rep:
|
Cant get entry in bind to work with domain.com instead of www.domain.com
Hi! I would like to get my bind dns to point domain.com to a website but cant get it to work. www.domain.com works just fine, what should i do?
here is my zone.
------------------------------------
; Database file domain.com.dns for domain.com zone.
@ IN SOA ns.domain.com. postmaster.domain.com. (
2005042502 ; serial number
3600 ; refresh
600 ; retry
604800 ; expire
3600 ) ; minimum TTL
;
; Zone NS records
;
@ 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.
---------------------------------------------------------
|
|
|
05-02-2005, 09:21 AM
|
#2
|
LQ Newbie
Registered: May 2005
Location: ahmedabad
Distribution: redhat9
Posts: 6
Rep:
|
I think u have too many @. Actually @ means authority and u have used too many of them and thats what is confusing.
try remove @ from mailexchanger and nameserver.
Last edited by nethunk; 05-02-2005 at 09:22 AM.
|
|
|
05-02-2005, 09:35 AM
|
#3
|
LQ Newbie
Registered: Sep 2003
Posts: 17
Original Poster
Rep:
|
Ok, thanks for your quick answer. should it be something like this then? I did the change but it didnt solved my problem yet.
; Database file domain.com.dns for domain.com zone.
@ IN SOA ns.domain.com. postmaster.domain.com. (
2005042502 ; serial number
3600 ; refresh
600 ; retry
604800 ; expire
3600 ) ; minimum TTL
;
; Zone NS records
;
@ 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.
|
|
|
05-02-2005, 09:37 AM
|
#4
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
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:
Code:
<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com www.domain.com
DocumentRoot /var/www/htdocs_domaincom
</VirtualHost>
|
|
|
05-02-2005, 09:49 AM
|
#5
|
LQ Newbie
Registered: Sep 2003
Posts: 17
Original Poster
Rep:
|
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?
|
|
|
05-02-2005, 11:08 AM
|
#6
|
LQ Newbie
Registered: May 2005
Location: ahmedabad
Distribution: redhat9
Posts: 6
Rep:
|
try using
/etc/init.d/named start do -f tail /var/log/messages
and then
cat /var/log/messages
and check where it gives error messages.
|
|
|
05-03-2005, 09:56 AM
|
#7
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
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:
Code:
<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com www.domain.com
DocumentRoot /var/www/htdocs_domaincom
</VirtualHost>
|
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.
|
|
|
05-06-2005, 09:29 AM
|
#8
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
You know, I was just looking over this thread again and noticed this...
Quote:
Originally posted by pxes351
...
www CNAME web2.domain2.om.
CNAME web2.domain2.com.
|
Was that a typo when you posted, or is it in the zonefile like that?
|
|
|
05-09-2005, 05:00 AM
|
#9
|
LQ Newbie
Registered: Sep 2003
Posts: 17
Original Poster
Rep:
|
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.
Thanks!
|
|
|
05-09-2005, 05:35 AM
|
#10
|
Member
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620
Rep:
|
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
|
|
|
05-09-2005, 05:47 AM
|
#11
|
LQ Newbie
Registered: Sep 2003
Posts: 17
Original Poster
Rep:
|
OK that did it!
but what is the difference between these two lines?
before:
A 1.2.3.4
after:
@ 1d IN A 1.2.3.4
|
|
|
05-09-2005, 06:13 AM
|
#12
|
Member
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620
Rep:
|
The first is a continuation record <GROAN!> I never use continuation records except in the SOA definition.
The second uses the @ sign. The @ sign is replaced with the zone name (domain name) specified in named.conf when the zone file is parsed at startup.
|
|
|
05-09-2005, 06:20 AM
|
#13
|
LQ Newbie
Registered: Sep 2003
Posts: 17
Original Poster
Rep:
|
Ok, thanks!
|
|
|
All times are GMT -5. The time now is 10:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|