View previous topic :: View next topic |
Author |
Message |
KraziKid Tux's lil' helper
Joined: 26 Dec 2002 Posts: 128
|
Posted: Thu Feb 06, 2003 4:34 am Post subject: BIND question |
|
|
Hello, everyone. I have a question with BIND. I used to use it as my DNS server, and it worked well (only used it really as a forward). I stopped using it because I wanted to host names from my hosts file, and couldn't figure out how to do it. Then I came across a little gem by the name of dnsmasq, which hosts names from the hosts file, and nameservers from resolv.conf. Lately it has started acting up, and some pages are not accessible behind it on my network. I have to either start BIND, or just change the nameserver on the workstations. Now, I want to start using BIND again, but would still like to be able to host names out of my hosts file. Does any one know how to do this, or some other way to relate a name with an IP on my network using BIND? Thanks ina advance for the help. |
|
Back to top |
|
|
fifo Guru
Joined: 14 Jan 2003 Posts: 437
|
Posted: Thu Feb 06, 2003 2:01 pm Post subject: |
|
|
I don't think bind is able to host names directly from the hosts file, but you can certainly set it up to act a nameserver for your internal network.
Suppose your network is: my.domain (192.168.0.0/255.255.255.0); with machines: machine1 (192.168.0.1) which is running bind, and machine2 (192.168.0.2); and forward nameserver 123.123.123.123. Then you'll have configuration files that look something like the following.
The main configuration file /etc/named.conf:
Code: |
options {
directory "/var/named";
forward only;
forwarders {
123.123.123.123;
};
listen-on {
192.168.0.1;
127.0.0.1;
};
};
zone "my.domain" IN {
type master;
file "my.domain";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "192.168.0";
allow-update { none; };
};
|
Association of names to addresses for the domain in /var/named/my.domain:
Code: |
$TTL 24H
@ IN SOA machine1.my.domain. root.localhost. (
2001081802 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expiry
86400 ) ; minimum
IN NS machine1.my.domain.
machine1 IN A 192.168.0.1
machine2 IN A 192.168.0.2
|
Association of addresses to names (for reverse lookups) in /var/named/192.168.0:
Code: |
$TTL 24H
@ IN SOA machine1.my.domain. root.localhost. (
2001081802 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expiry
86400 ) ; minimum
IN NS machine1.my.domain.
0 IN A 255.255.255.0
1 IN PTR machine1.my.domain.
2 IN PTR machine2.my.domain.
|
Note that I'm running a slightly older version of bind, and I've got it running on a Slackware box, so maybe some of the details above have to be modified, but I hope this is useful. Of course, there's plenty of documentation on setting up bind out there, which will explain what all this actually means . |
|
Back to top |
|
|
KraziKid Tux's lil' helper
Joined: 26 Dec 2002 Posts: 128
|
Posted: Thu Feb 06, 2003 8:11 pm Post subject: |
|
|
Perfect, it works. Thank you so much. |
|
Back to top |
|
|
|
|
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
|
|