![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Spilled the Beans
![]() Join Date: Mar 2006
Location: Dublin, Ireland
Beans: 13
Ubuntu 6.06
|
Howto: Setup a DNS server with bind
After looking on Ubuntu forum for an easy step-by-step howto for instaling a DNS server, I decided the best idea would probably be to write this howto myself.... So, here it is!
Step 1: Install Ubuntu dapper, or use your WORKING installation. Step2: Install bind 9: Code:
sudo apt-get install bind9 Code:
sudo vi /etc/bind/named.conf.local Insert this in the named.conf.local file: Code:
# This is the zone definition. replace example.com with your domain name
zone "example.com" {
type master;
file "/etc/bind/zones/example.com.db";
};
# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
Code:
sudo vi /etc/bind/named.conf.options Code:
forwarders {
# Replace the address below with the address of your provider's DNS server
123.123.123.123;
};
Code:
sudo mkdir /etc/bind/zones sudo vi /etc/bind/zones/example.com.db Code:
// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com. IN SOA ns1.example.com. admin.example.com. (
// Do not modify the following lines!
2006081401
28800
3600
604800
38400
)
// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com. IN NS ns1.example.com.
example.com. IN MX 10 mta.example.com.
// Replace the IP address with the right IP addresses.
www IN A 192.168.0.2
mta IN A 192.168.0.3
ns1 IN A 192.168.0.1
Code:
sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa Code:
//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1.
@ IN SOA ns1.example.com. admin.example.com. (
2006081401;
28800;
604800;
604800;
86400
)
IN NS ns1.example.com.
1 IN PTR example.com
Code:
sudo /etc/init.d/bind9 restart Step 4: Modify the file resolv.conf with the following settings: Code:
sudo vi /etc/resolv.conf Code:
// replace example.com with your domain name, and 192.168.0.1 with the address of your new DNS server. search example.com nameserver 192.168.0.1 Code:
dig example.com Also, this post is not perfect... Do not hesitate to improve it!
__________________
-------------------------- Canard Pimpant Last edited by tomtom_in_eire; August 15th, 2006 at 03:38 AM.. |
|
|
|
|
|
#2 |
|
5 Cups of Ubuntu
![]() Join Date: Aug 2006
Beans: 33
|
Re: Howto: Setup a DNS server with bind
I have setup my hp xg833, 733mhz and 384megs ram, just as you have above. I have even cut and pasted through putty. I have then set one of my other machines to go to the dns server to only have it say not able to reach the website I want to reach. Basically I am using the dns server for the intranet and the internet. I thought that once it did not find what I was looking for on the intranet it would go to the ISP, which I have set the ip addresses and host, on to the internet. Is this thinking correct? I am stumped.
Thanks larka06 email at larka51@netscape.net I also can meet you on the IRC channel or anywhere you want me to be |
|
|
|
|
|
#3 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2006
Location: Jackson, MS
Beans: 37
Gutsy Gibbon Testing
|
Re: Howto: Setup a DNS server with bind
One more step to get it to work:
You must rename the named.conf.local to named.conf |
|
|
|
|
|
#4 |
|
5 Cups of Ubuntu
![]() Join Date: Jun 2006
Beans: 37
|
Re: Howto: Setup a DNS server with bind
Nice tutorial , i was working with this and with a tutorial that is in this page http://www.aboutdebian.com/dns.htm
The thing its that im not sure if a did everything well, i dont know how to test this.. y dig mekas.com and this says the terminal: dantec@ubuntu:~$ dig mekas.com ; <<>> DiG 9.3.2 <<>> mekas.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 9469 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;mekas.com. IN A ;; Query time: 12 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Sep 18 00:42:30 2006 ;; MSG SIZE rcvd: 27 if i dig something wrong, i get this: dantec@ubuntu:~$ dig tadeo.meks.com ; <<>> DiG 9.3.2 <<>> tadeo.meks.com ;; global options: printcmd ;; connection timed out; no servers could be reached I think its working, but i need to be sure, please i will apreciate if u help me, im kind of newbie in linux and i need to mount a dns server 4 a class ;) THX a lot Regards MeKaS |
|
|
|
|
|
#5 |
|
First Cup of Ubuntu
![]() Join Date: Aug 2006
Beans: 3
|
Re: Howto: Setup a DNS server with bind
When I try and install bnd9, here is what I get..Any ideas ?
sudo apt-get install bind9 Reading package lists... Done Building dependency tree... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help to resolve the situation: The following packages have unmet dependencies: bind9: Depends: libdns21 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed Depends: libisccfg1 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed Depends: libisc11 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed Depends: libisccc0 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed |
|
|
|
|
|
#6 |
|
Way Too Much Ubuntu
![]() |
Re: Howto: Setup a DNS server with bind
must domain be registered or not?
Can i use no-ip.com domain? I am using router so which port must o foward for bind server? www IN A 192.168.1.5 mta IN A 192.168.1.5 ns1 IN A 192.168.1.5 can i use for all three the same ip and the same machine?
__________________
Juventus the champion |
|
|
|
|
|
#7 |
|
First Cup of Ubuntu
![]() Join Date: Oct 2006
Location: Sweden
Beans: 12
Ubuntu 5.10
|
Re: Howto: Setup a DNS server with bind
I also had trouble installing bind9, so I tried to write:
apt-get install bind and that gave me version 8.4.6-1. I'm sure this will suffice for my simple home network. |
|
|
|
|
|
#8 |
|
5 Cups of Ubuntu
![]() |
Re: Howto: Setup a DNS server with bind
Thanks for the tutorial. I have a dynu account and used this as my domain name. I believe dynu is similar to no-ip.com. I installed bind9 with synaptic in edgy, and followed your directions. Works without a problem.
|
|
|
|
|
|
#9 |
|
Just Give Me the Beans!
![]() Join Date: Dec 2005
Location: Philly PA, USA
Beans: 80
Ubuntu 7.10 Gutsy Gibbon
|
Re: Howto: Setup a DNS server with bind
Does this work for Edgy?
I would like to set up a "chrooted" bind server for local traffic and Internet forwarding. Would this tutorial work? I was trying to follow on howtoforge.com regarding "A perfect setup" for Edgy 6.10 server, but ran into trouble when I came to setting up bind9. I understand DNS, just not bind. Thx /J
__________________
I'm tryin...
|
|
|
|
|
|
#10 |
|
First Cup of Ubuntu
![]() Join Date: Nov 2006
Location: Prague
Beans: 1
Kubuntu 6.06 Dapper
|
Finaly, what I was looking for.
Thanks a lot. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|