LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-02-2005, 10:09 AM   #1
pxes351
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Rep: Reputation: 0
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.
---------------------------------------------------------
 
Old 05-02-2005, 10:21 AM   #2
nethunk
LQ Newbie
 
Registered: May 2005
Location: ahmedabad
Distribution: redhat9
Posts: 6

Rep: Reputation: 0
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 10:22 AM.
 
Old 05-02-2005, 10:35 AM   #3
pxes351
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Original Poster
Rep: Reputation: 0
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.
 
Old 05-02-2005, 10:37 AM   #4
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
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>
 
Old 05-02-2005, 10:49 AM   #5
pxes351
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Original Poster
Rep: Reputation: 0
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?
 
Old 05-02-2005, 12:08 PM   #6
nethunk
LQ Newbie
 
Registered: May 2005
Location: ahmedabad
Distribution: redhat9
Posts: 6

Rep: Reputation: 0
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.
 
Old 05-03-2005, 10:56 AM   #7
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
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.
 
Old 05-06-2005, 10:29 AM   #8
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
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?
 
Old 05-09-2005, 06:00 AM   #9
pxes351
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Original Poster
Rep: Reputation: 0
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!
 
Old 05-09-2005, 06:35 AM   #10
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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
 
Old 05-09-2005, 06:47 AM   #11
pxes351
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Original Poster
Rep: Reputation: 0
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
 
Old 05-09-2005, 07:13 AM   #12
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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.
 
Old 05-09-2005, 07:20 AM   #13
pxes351
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Original Poster
Rep: Reputation: 0
Ok, thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind - Why won't my LAN domain work? jimieee Linux - Networking 1 05-09-2005 01:07 PM
Configuring BIND to work with a domain name Immolo Linux - Networking 4 04-20-2005 07:32 AM
www.domain.com instead of domain.com pyrombca Linux - Software 1 11-04-2004 03:36 PM
having problems getting the www to work with my domain name slawrence Linux - Networking 2 07-04-2004 11:13 AM
BIND only resolving domain if no "www." noisybastard Linux - Networking 2 11-04-2003 09:19 AM


All times are GMT -5. The time now is 10:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration