how to set up bind for a home network
Roger Grosswiler
roger at gwch.net
Wed Jul 13 06:51:28 UTC 2005
> Hello
> I bought a new router that does not resolve to my email server or my
> apache server when I enter my domain name in the browser. My previous
> old Linkys router never gave me this problem. D-Link tech support
> informed me that I needed to set up and run a DNS server inside my
> network of three computers for it to work. Right now every time I try
> to go to my domain the router takes me to its login screen. The
> router is the DSL-504T model.
> So, can anyone tell me how to configure my DNS server to resolve to
> my domain name inside my network?
> Thanks
> EJ
i imagine, calling your domain-name hopefully doesnt bring up the
login-prompt for your firewall ;-)
i have an older di-804, i had to setup also a small dns for home. it's not
that trivial, but it's even not that heavy.
1) copy your named.conf to somewhat, so you have an original-backup
2) edit your named.conf:
-> edit the options-section, so it looks something like
options {
directory "/var/named";
notify no;
forward first;
forwarders { yourdlinksip; external-dns1; external-dns2; } ;
};
this says, that if the ip-adress/fqdn is not found in your domain here, it
forwards the resolving-request to external dns-servers.
-> add your domain-zone
zone "domain.tld" IN {
type master;
file "domain.db";
};
-> and as a helper a reverse-zone
zone "0.168.192.in-addr.arpa" IN {
type master;
file "168.192.db";
};
if you have chrooted named, copy this also to /var/named/chroot/etc
...thats it. now you have to create your zonefiles in either /var/named
oder if you have chrooted your environement in /var/named/chroot/var/named
create the two files mentionned in /etc/named.conf (domain.db & 168.192.db)
content of domain.db:
$ORIGIN .
$TTL 86400 ; 1 day
yourdomain.tld IN SOA host.yourdomain.tld.
root.host.yourdomain.tld. (
2005000001 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS host.yourdomain.tld.
A [ip-adress of your nameserver]
MX 0 mailserver.domain.tld.
$ORIGIN yourdomain.tld.
hostname A ip-adress
hostname A ip-adress
www CNAME hostname -> this create an alias, so you
can call www.yourdomain.tld, as an example
...this is your forward-zone. set the values as you need an like it ;-)
...now lets do some work for the reverse.zone open 168.192.db and insert:
$ORIGIN .
$TTL 86400 ; 23 hours 30 minutes
0.168.192.in-addr.arpa IN SOA IN SOA host.yourdomain.tld.
root.host.yourdomain.tld. (
2005000001 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS host.yourdomain.tld.
A [ip-adress of your host
$ORIGIN 0.168.192.in-addr.arpa
last 3 digits of ip-add PTR router.yourdomain.tld.
100 PTR host.yourdomain.tld.
101 PTR host.yourdomain.tld.
replace also here the values to your gusto :-D
...save it and do service named start. check for error messages in
/var/log/messages, i think, this should work.
HTH
Roger
More information about the fedora-list
mailing list