I'm using BIND9 in Ubuntu to setup a local DNS that is shared by a LAN.
Here is what I want to achieve:
- The BIND9 server and Apache server sits on 192.168.1.65 and currently the web server is accessible via this IP address (192.168.1.65).
- Now I want to use customized domain names so that everyone in the network can easily remember the url: http://xyz.local/ (instead of http://192.168.1.65/)
- And these sub domains also need to be setup, ape.xyz.local, *.ape.xyz.local (where * is any number)
- If a user entered http://google.com, the dns server still can forward the request to ISP DNS, otherwise, if http://xyz.local/ is accessed, the 192.168.1.65 web server should be accessed.
Can anyone help with how can I setup that?
Here is what I have tried so far, but with no luck getting it work:
BIND zone file: db.xyz.local
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.xyz.local. root.xyz.local. (
2011041608 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.xyz.local.
ns IN A 192.168.1.65
ape IN A 192.168.1.65
reverse zone file: db.192
; ; BIND reverse data file for local loopback interface ;
$TTL 604800
@ IN SOA ns.xyz.local. root.xyz.local. (
2011041609 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
65 IN PTR ns.xyz.local.
And this is named.conf.local
# Our domain zone
zone "xyz.com" {
type master;
file "/etc/bind/db.xyz.local";
};
# For reverse DNS
zone "1.168.192.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.192";
};
But now, it seems that I cannot access ape.xyz.local.