Click to See Complete Forum and Search --> : Named


Falcon
06-13-2001, 10:20 PM
I installed Named and got it to launch. Now I am hopelessly lost as I could not find an NHF. I found the config files (/etc/named.config and /var/named/ or something) and am trying to figure it out. All I want to do is use it as a named server so I can set the DNS entrys at www.somesite.com (http://www.somesite.com) to my site and have it link it to my domain and then just set up a <virtualhost> in apache. I might need to host two-three domains. How do I do this?

BTW, I might have fsked up the config file, it works but I'm not sure how well.

Falcon

Craig McPherson
06-14-2001, 12:25 AM
I'm working on a reply to this, but it might be fairly long, so give me half an hour or so to finish it. I'm easily distracted.

Craig McPherson
06-14-2001, 01:45 AM
First of all, do you have a 100% static IP address? To be the nameserver for a domain, your IP has to be static, and you have to register your nameserver with the domain registrar.

Now, that being said.

BIND is a complex thing and you really have to read some documentation. If possible, pick up a copy of O'Reilly's DNS and Bind, but if you want to do it like I did, you can just hunt down some documentation on Google.

For an ABSOLUTELY MINIMAL setup, you could have a named.conf like this:


options {
directory "/var/cache/bind";
};

zone "." {
type hint;
file "/etc/bind/named.root";
};

zone "domain1.com" {
type master;
file "/etc/bind/db.domain1";
allow-query{
0.0.0.0/0;
};
};



Here's an ABSOLUTELY MINIMAL db.domain1 zone file:


$TTL 86400

@ IN SOA domain1.com. root.domain1.com. (
20000901 ; serial
28800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; minimum

IN NS XYZ.XYZ.XYZ.XYZ.
@ IN MX 10 XYZ.XYZ.XYZ.XYZ.
@ IN A XYZ.XYZ.XYZ.XYZ

www IN CNAME @


XYZ.XYZ.XYZ.XYZ is your Internet IP, of course.

Falcon
06-14-2001, 10:34 AM
Wow, thanks a LOT! I will go and set that up now.

Falcon

Falcon
06-14-2001, 10:52 AM
I set it up and got....
** server can't find domian.com.:SERVFAIL

This is my /etc/named.conf file


options {
directory "/var/named/";
};

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

zone "domain.com." {
type master;
file "/var/named/domain";
allow-query{
0.0.0.0/0;
};
};


And this is my /var/named/domain file

$TTL 86400

@ IN SOA domain.com. root.domain.com. (
20000901 ; serial
28800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; minimum
IN NS 255.255.255.255.
@ IN MX 10 255.255.255.255.
@ IN A 255.255.255.255.
www IN CNAME @


The only things I have changed are my IP (255.255.255.255) and the domain (domain.com). If you can let me know what I did wrong that would be great. It only says that error message when I nslookup domain.com on my comp, if I nslookup another it does nothing.

Falcon

freebsd
06-14-2001, 12:10 PM
>> file "/var/named/domain";

This should be changed to file "domain"; because you have specified directory "/var/named/"; option and domain is a RELATIVE PATH to /var/named. That said, your named.ca should reside in /var/named as well. Also this line directory "/var/named/";, you don't need the trailing slash after /var/named/.

>> allow-query{ 0.0.0.0/0; };

Use allow-transfer { any; }; instead.

>> IN NS 255.255.255.255.

It should be the hostname of NS, not the IP.

>> @ IN MX 10 255.255.255.255.

Same situation as above.

>> @ IN A 255.255.255.255.

No trailing dot.

>> @ IN SOA domain.com

Unqualify hostname. It should be something like ns1.domain.com. Therefore, you also need to add an A record for ns1.domain.com.

Change the preference order of MX, A and CNAME to be A first, CNAME next, MX last.
This seems to be a standalone master nameserver, so you also need to add allow-transfer { none; }; within options. It's a good practice to hide the version of BIND you are running, so add version ""; under options as well.

Finally, if you want to solve your problem fast, post real data, no example please. It's helpful to us as well as yourself to see real data for DNS stuff.

Falcon
06-14-2001, 09:48 PM
Okay, this isn't working. If someone could do me a BIG favor and tell me how to set up my NAMED config files to:

1) Send any requests to "somecooldomain.com" (not sure which one I want yet) and any of its subdomains to the IP 65.4.219.217. Also info on how to set up another domain would be great. I use RedHat 7.1 and had it install a DNS server. I don't need it to be a mail server or anything else. I might do that but it would be with everyone.net as I don't have the time to mess with it. I just want to point the nameserver records for somecooldomain.com to my server, have the DNS look it up, and have it send it to my apache virtual host stuff. If you can make it step by step (I am a semi-competent linux user, just don't skip B between A and C as I know NO dns stuff).

Thanks a million for being patient with me and helping me out. I know you all have better things to do (like work, but hey, linux IS better than work :D "

:eek:Falcon :eek:

Craig McPherson
06-15-2001, 01:47 AM
Mr. Falcon,

Did you try my example files, with the changes Mr. FreeBSD suggested? Those files worked fine for me, however my nameserver isn't public, it's only for the local intranet, so I imagine some things would have to be fiddled with.

If you did try changing the things Mr. FreeBSD suggested, what kind of errors did you get when you tried to start BIND?

Now, let me offer you another suggestion: why not just sign up for a free account at Granite Canyon and have them do your DNS? You could have your DNS set up in under five minutes, a lot faster than it'll take the average person to learn all about BIND zone files.

If you just go to www.granitecanyon.com, (http://www.granitecanyon.com,) click on the "Create Primary DNS" link, and enter in your domain and a password there, you can have your DNS up really quick. You'll need to register secondary DNS as well.

Once you get the domain registered with Granite Canyon, your domain records will be in their zone files. At that point, you can go to your domain registrar and enter Granite Canyon's nameservers as the primary and secondary nameservers for your zone.

I know you want to get Bind working, but going through Granite Canyon would be a lot less work.

Craig McPherson
06-15-2001, 01:50 AM
Granite Canyon's FAQ is here (http://www.granitecanyon.com/faq.shtml). You didn't mention if you already have your domain registered or not, but if you don't, I'd recommend Gandi (http://www.gandi.net/), which is about $10/year (their price if fixed on Euros, so the price in US dollars may fluctuate). I do NOT recommend Discount Domain Registry. Although they're only $15, year (50% more than Gandi... hmm), their service is sub-par and their web site is AWFUL.

Falcon
06-15-2001, 09:57 PM
Okay. I set it up like you said and got the first to changes, but I got lost with the other two. I am not sure what you mean.

BIND starts find, I just get an error when I try to "NSLOOKUP somecooldomain.com 65.4.219.217". It gives me the error I posted above.

Thanks,
Falcon

freebsd
06-16-2001, 02:06 AM
>> I just get an error when I try to "NSLOOKUP somecooldomain.com 65.4.219.217"

Because there is no such command as NSLOOKUP.
Is somecooldomain.com your real domain or just example?

>> It gives me the error I posted above

What error? This -> * server can't find domian.com.:SERVFAIL? No example, real data please.

Falcon
06-16-2001, 01:24 PM
On my RedHat 7.1 box NSLOOKUP is a command. It will pull the name servers of a certain listing. NSLOOKUP domain.com 127.0.0.1 will contact the DNS server on 127.0.0.1 and get the nameservers listed for domain.com. It returns that error when I try to do that (I set up to list to domain.com even though I do not own it so you can have REAL data).

Falcon

Falcon
06-18-2001, 11:44 PM
Ok, I got it so that when my NAMED server is asked for domain.com it says the IP is 65.4.219.217. Now do I just set the DNS records for the domain for whatever my hostname is and use my IP? Do I just use a <VirtualHost 65.4.219.217> thingy set for domain.com to make it work?

Thanks,
Falcon