Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BIND - setup a simple domain
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Tue Nov 02, 2004 7:35 pm    Post subject: BIND - setup a simple domain Reply with quote

I'm having problems w/ BIND, mostly because I'm new to it and not sure if I'm doing this right.

I'm trying to setup a simple domain; manicuremagic.tv

Here's my vhosts in apache:

Code:

NameVirtualHost manicuremagic.tv:80
<VirtualHost manicuremagic.tv:80>
        DocumentRoot /var/www/localhost/htdocs/manicuremagic.tv
        ServerName manicuremagic.tv:80
        ErrorLog /var/www/localhost/htdocs/manicuremagic.tv/logs/manicuremagic_tv_log
</VirtualHost>

NameVirtualHost www.manicuremagic.tv:80
<VirtualHost www.manicuremagic.tv:80>
        DocumentRoot /var/www/localhost/htdocs/manicuremagic.tv
        ServerName manicuremagic.tv:80
        ErrorLog /var/www/localhost/htdocs/manicuremagic.tv/logs/manicuremagic_tv_log
</VirtualHost>


Here's my named.conf entry:

Code:

zone "manicuremagic.tv" IN {
        type master;
        file "pri/manicuremagic.tv.zone";
        allow-update { none; };
        notify no;
};


Here's my zone file:

Code:

$TTL 604800
@       IN      SOA     manicuremagic.tv. hostmaster.manicuremagic.tv.  (
                                      2002081601 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      604800     ; Expire - 1 week
                                      86400 )    ; Minimum
                        IN      NS      ns1.mbcchosting.com.
                        IN      NS      ns2.mbcchosting.com.

                        IN      MX 10   mail.mbcchosting.com.

                        IN      A       204.225.92.134

manicuremaigc.tv        IN      A       204.225.92.134

www                     IN      CNAME   manicuremagic.tv.


I tried this w/o the "manicuremaigc.tv IN A 204.225.92.134" line (second from the bottom) but it made no difference.

I can get manicuremagic.tv to work but not www.manicuremagic.tv (it times out)....what am I doing wrong??

Thanks![/b]
Back to top
View user's profile Send private message
liber!
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2004
Posts: 123
Location: EU, Antwerp

PostPosted: Tue Nov 02, 2004 7:42 pm    Post subject: Reply with quote

remove the IN before CNAME, then it should work...

Greetings,
Nathan
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Tue Nov 02, 2004 7:45 pm    Post subject: nope... Reply with quote

liber! wrote:
remove the IN before CNAME, then it should work...

Greetings,
Nathan


I mentioned in my post that I had tried that and it doesn't work. I just tried again, just to be sure, and it isn't working - you can see for yourself by going to these domains via http.
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Tue Nov 02, 2004 8:57 pm    Post subject: Re: BIND - setup a simple domain Reply with quote

zambizzi wrote:
Code:

manicuremaigc.tv        IN      A       204.225.92.134



manicuremaigc.tv, or manicuremagic.tv?

Dave
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Tue Nov 02, 2004 9:03 pm    Post subject: Re: BIND - setup a simple domain Reply with quote

DaveArb wrote:
zambizzi wrote:
Code:

manicuremaigc.tv        IN      A       204.225.92.134



manicuremaigc.tv, or manicuremagic.tv?

Dave


Argh...dumb spelling error, however, I had already removed that line and it hadn't fixed it.

I put it back in w/ correct spelling, restarted named, and it still doesn't work.

This is maddening! :evil:

I've been googling up and down and by all means, it looks like I'm doing it correctly...

The book I have here also says I've got it right...
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Tue Nov 02, 2004 9:22 pm    Post subject: Reply with quote

On to next then...

Code:
@       IN      SOA     manicuremagic.tv. hostmaster.manicuremagic.tv.  (


The "Cricket Book" uses this example (I changed the domain names for standards compliance):
Code:
@ IN SOA terminator.movie.example. al.robocop.movie.example. (


With regard to `terminator.movie.example`, they say "is the name of the primary master name server for the movie.example zone." You have listed the domain name, and I haven't the first idea if that's an error or not. My zone master files list a specific host in this field.

Somewhere stuck in my dusty old brain, I want to recall that the right-hand side of a CNAME record needs to be a hostname, you have a domain name listed. Can't find it quickly in the book, and I can't even remember how good my memory used to be, so could easily be mistaken.

It is at least odd looking to me that you don't have any A records for a specific host name. Again don't know if it's an error, but I can't recall ever seeing a zone master that didn't have one.

Dave
Back to top
View user's profile Send private message
liber!
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2004
Posts: 123
Location: EU, Antwerp

PostPosted: Tue Nov 02, 2004 10:32 pm    Post subject: Re: nope... Reply with quote

zambizzi wrote:
liber! wrote:
remove the IN before CNAME, then it should work...

Greetings,
Nathan


I mentioned in my post that I had tried that and it doesn't work. I just tried again, just to be sure, and it isn't working - you can see for yourself by going to these domains via http.


No you didn't point it out in your first post...
Quote:
I tried this w/o the "manicuremaigc.tv IN A 204.225.92.134" line (second from the bottom) but it made no difference.
this is about the A record.

But it's okay now...

Nathan
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Tue Nov 02, 2004 11:29 pm    Post subject: ahh! Reply with quote

Ok, this is really strange, I shut named off and nothing changed...I can still resolve the site w/o the "www", but not with it...just like before.

It would appear named was never interacting w/ Apache to begin with, what's going on here?
Back to top
View user's profile Send private message
liber!
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2004
Posts: 123
Location: EU, Antwerp

PostPosted: Wed Nov 03, 2004 12:00 am    Post subject: Reply with quote

Don't forget dns is cached on all servers, so it might take a wile before you see your new changes. But if you see on the same server still the old version, there is something wrong.

And yes, bind and apache don't interact.

And also your apache vhost settings I would do them different...

Code:

NameVirtualHost 204.225.92.134:80
<VirtualHost 204.225.92.134:80>
        DocumentRoot /var/www/localhost/htdocs/manicuremagic.tv
        ServerName manicuremagic.tv
        ServerAlias www
        ErrorLog /var/www/localhost/htdocs/manicuremagic.tv/logs/manicuremagic_tv_log
</VirtualHost>

It is no use creating 2 virtualhosts if you only need one alias.

B.T.W. Checking directly on your dns server gives me this (I bypased the slow isp caches with the @). It means that your zone isn't loaded in named. Did you do a rndc reload (not just a rndc reload zone)?
Code:

nathan@socrates nathan $ dig manicuremagic.tv @204.225.92.134     
; <<>> DiG 9.2.3 <<>> manicuremagic.tv @204.225.92.134
;; global options:  printcmd
;; connection timed out; no servers could be reached
nathan@socrates nathan $


Hope I helped,
Nathan
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Wed Nov 03, 2004 12:21 am    Post subject: ....... Reply with quote

Ok, here's what I did, I started fresh with a domain that has been pointing to my domain servers for a LONG time but was never configured, I'm having the same problem.

I registered two domain name servers w/ go daddy, they are:

ns1.mbcchosting.com
ns2.mbcchosting.com

...both point to 204.225.92.134 (I was asked to do it this way, don't point at me :wink: )

Here is the vhost entry for mbcchosting.com:

Code:

NameVirtualHost mbcchosting.com:80
<VirtualHost 204.225.92.134:80>
        DocumentRoot /var/www/localhost/htdocs/mbcchosting.com
        ServerName mbcchosting.com
        ServerAlias www
        ErrorLog /var/www/localhost/htdocs/mbcchosting.com/logs/mbcchosting_com_log
</VirtualHost>


...and the named.conf entry:

Code:

zone "mbcchosting.com" IN {
        type master;
        file "pri/mbcchosting.com.zone";
        allow-update { none; };
        notify no;
};


...and the zone record:

Code:

$TTL 604800
@       IN      SOA     mbcchosting.com. hostmaster.mbcchosting.com.  (
                                      2002081601 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      604800     ; Expire - 1 week
                                      86400 )    ; Minimum
                IN      NS      ns1.mbcchosting.com.
                IN      MX 10   mail.mbcchosting.com.
                IN      A       204.225.92.134
www             IN      CNAME   204.225.93.134


Again, the exact same results...doesn't work w/ "www".

I might just go sit in the corner and freak out for a while... 8O
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Wed Nov 03, 2004 1:26 am    Post subject: pinga Reply with quote

When I ssh into the server and try to ping my nameservers (ns1.mbcchosting.com and ns2...) I get "ping: unknown host ns1.mbcchosting.com"...and the same for ns2.

Does this tell anyone anything?

It's odd because I can ping them from my local box and from another remote (windows) server on a different network......

:?:
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Wed Nov 03, 2004 4:55 am    Post subject: Meanwhile...back at the ranch.... Reply with quote

Ok, here's where I'm at. I can get mbcchosting.com and www.mbcchosting.com to work, both pointing to the correct directory.

I can get manicuremagic.tv and manicure-magic.com to work but both of those with "www" in front of them is broken!

Summary (bold = incorrect):

mbcchosting.com -> mbcchosting.com
www.mbcchosting.com -> mbcchosting.com

manicuremagic.tv -> manicuremagic.tv
www.manicuremagic.tv -> mbcchosting.com

manicure-magic.com -> manicure-magic.com
www.manicure-magic.com -> DEAD, GOES NOWHERE

Remember, ns1.mbcchosting.com & ns2.mbcchosting.com are my name servers, both registered with the IP 204.225.92.134

Here's my vhosts.conf:

Code:

#mbcchosting.com
NameVirtualHost 204.225.92.134:80
<VirtualHost 204.225.92.134:80>
        DocumentRoot /var/www/localhost/htdocs/mbcchosting.com
        ServerName mbcchosting.com
        ServerAlias www
        ErrorLog /var/www/localhost/htdocs/mbcchosting.com/logs/mbcchosting_com_log
</VirtualHost>

#manicuremagic.tv
NameVirtualHost 204.225.92.134:80
<VirtualHost 204.225.92.134:80>
        DocumentRoot /var/www/localhost/htdocs/manicuremagic.tv
        ServerName manicuremagic.tv
        ServerAlias www
        ErrorLog /var/www/localhost/htdocs/manicuremagic.tv/logs/manicuremagic_tv_log
</VirtualHost>

#manicure-magic.com
NameVirtualHost 204.225.92.134:80
<VirtualHost 204.225.92.134:80>
        DocumentRoot /var/www/localhost/htdocs/manicure-magic.com
        ServerName manicure-magic.com
        ServerAlias www
        ErrorLog /var/www/localhost/htdocs/manicure-magic.com/logs/manicure-magic_com_log
</VirtualHost>


...named.conf

Code:

options {
        directory "/var/bind";

        // uncomment the following lines to turn on DNS forwarding,
        // and change the forwarding ip address(es) :
        //forward first;
        //forwarders {
        //      123.123.123.123;
        //      123.123.123.123;
        //};

        listen-on-v6 { none; };
        listen-on { 127.0.0.1; 204.225.92.134; 204.225.92.135; 204.225.92.137; };

        // to allow only specific hosts to use the DNS server:
        //allow-query {
        //      127.0.0.1;
        //};

        // if you have problems and are behind a firewall:
        //query-source address * port 53;
        pid-file "/var/run/named/named.pid";
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "pri/localhost.zone";
        allow-update { none; };
        notify no;
};

zone "127.in-addr.arpa" IN {
        type master;
        file "pri/127.zone";
        allow-update { none; };
        notify no;
};

//primary domain for entire server mbcchosting.com
zone "mbcchosting.com" IN {
        type master;
        file "pri/mbcchosting.com.zone";
        allow-update { none; };
        notify no;
};

//primary domain for entire server manicuremagic.tv
zone "manicuremagic.tv" IN {
        type master;
        file "pri/manicuremagic.tv.zone";
        allow-update { none; };
        notify no;
};

//primary domain for entire server manicure-magic.com
zone "manicure-magic.com" IN {
        type master;
        file "pri/manicure-magic.com.zone";
        allow-update { none; };
        notify no;
};


...mbcchosting.com, manicuremagic.tv, and manicure-magic.com zone files, respectively. You'll notice where I added ns1 and ns2 for mbcchosting.com (not even sure if this is correct?)

Code:

$TTL 604800
@       IN      SOA     mbcchosting.com. hostmaster.mbcchosting.com.  (
                                      2002081601 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      604800     ; Expire - 1 week
                                      86400 )    ; Minimum
                IN      NS      ns1.mbcchosting.com.
                IN      NS      ns2.mbcchosting.com.

                IN      MX 10   mail.mbcchosting.com.

                IN      A       204.225.92.134

ns1             IN      A       204.225.92.134
ns2             IN      A       204.225.92.134

www             IN      A       204.225.92.134


Code:

$TTL 604800
@       IN      SOA     manicuremagic.tv. hostmaster.manicuremagic.tv.  (
                                      2002081601 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      604800     ; Expire - 1 week
                                      86400 )    ; Minimum
                        IN      NS      ns1.mbcchosting.com.
                        IN      NS      ns2.mbcchosting.com.

                        IN      MX 10   mail.manicuremagic.tv.

                        IN      A       204.225.92.134
www                     IN      A       204.225.92.134


Code:

$TTL 604800
@       IN      SOA     manicure-magic.com. hostmaster.manicure-magic.com.  (
                                      2002081601 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      604800     ; Expire - 1 week
                                      86400 )    ; Minimum
                IN      NS      ns1.mbcchosting.com.
                IN      NS      ns2.mbcchosting.com.

                IN      MX 10   mail.manicure-magic.com.

                IN      A       204.225.92.134
www             IN      A       204.225.93.134


I keep reading about using CNAME records for www but what would I point them to??

I'm at a complete standstill and I have no idea what to do to make this work. I can't find any literature telling me that this is incorrect but I also can't find anything specific to setting up your own DNS servers and then trying to host sites on them like I've done here.

If someone could please post some examples of this type of example that works, it would be GREATLY appreciated!! :D

Thanks again everyone!
Back to top
View user's profile Send private message
MrBlc
n00b
n00b


Joined: 16 Mar 2004
Posts: 30

PostPosted: Wed Nov 10, 2004 5:08 pm    Post subject: hmm.. Reply with quote

From what i can see, there's a reason why you didn't get this working..
I'm trying to teach myself DNS nowadays, and from the examples i can see, this line is wrong:


Code:

www                     IN      A       204.225.92.134


as liber! posted in the first response.. (although a bit cryptic, and from what i can see, also misunderstood by you...)

The correct line would be:
Code:

www                       A       204.225.92.134


hope that solves your issues.. (it should..)
-lordblc[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum