Re: Howto: Setup a DNS server with bind
I fixed my problem. I have my domain running I think. The problem is I cannot browse to the my internal site via the new domain name.
Here are the results of the tests:
Code:
ja@x:/etc/apache2$ ping x.local
PING x.local (127.0.1.1) 56(84) bytes of data.
64 bytes from x.local (127.0.1.1): icmp_seq=1 ttl=64 time=0.014 ms
64 bytes from x.local (127.0.1.1): icmp_seq=2 ttl=64 time=0.012 ms
64 bytes from x.local (127.0.1.1): icmp_seq=3 ttl=64 time=0.012 ms
64 bytes from x.local (127.0.1.1): icmp_seq=4 ttl=64 time=0.013 ms
^C
--- x.local ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2998ms
rtt min/avg/max/mdev = 0.012/0.012/0.014/0.004 ms
ja@x:/etc/apache2$ dig x.local
; <<>> DiG 9.7.0-P1 <<>> x.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64267
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;x.local. IN A
;; AUTHORITY SECTION:
x.local. 38400 IN SOA ns1.x.local. admin.x.local. 2010011001 28800 3600 604800 38400
ja@xserv:/etc/apache2$ dig -x 127.0.0.1
; <<>> DiG 9.7.0-P1 <<>> -x 127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64924
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; QUESTION SECTION:
;1.0.0.127.in-addr.arpa. IN PTR
;; ANSWER SECTION:
1.0.0.127.in-addr.arpa. 604800 IN PTR localhost.
;; AUTHORITY SECTION:
127.in-addr.arpa. 604800 IN NS localhost.
;; ADDITIONAL SECTION:
localhost. 604800 IN A 127.0.0.1
localhost. 604800 IN AAAA ::1
;; Query time: 0 msec
;; SERVER: 192.168.2.20#53(192.168.2.20)
;; WHEN: Mon Jan 10 20:43:47 2011
;; MSG SIZE rcvd: 121
ja@xserv:/etc/bind$ named-checkzone x.local /etc/bind/zones/x.local.db
/etc/bind/zones/x.local.db:1: no TTL specified; using SOA MINTTL instead
zone x.local/IN: loaded serial 2010011001
OK
It seems as though I have everything configured correctly, yet I still cannot browse to the site I have hosted off of the nameserver 192.168.2.20. The router ip is 192.168.2.1.
Here are my files:
named.conf.local
Code:
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
# This is the zone definition. replace example.com with your domain name
zone "x.local" {
type master;
file "/etc/bind/zones/x.local.db";
};
zone "2.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.2.168.192.in-addr.arpa";
named.conf.options
Code:
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
192.168.2.1;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
x.local.db
Code:
x.local. IN SOA ns1.x.local. admin.x.local. (
2010011001
28800
3600
604800
38400
);
x.local. IN NS ns1.x.local.
www IN A 192.168.2.20
ns1 IN A 192.168.2.20
* IN A 192.168.2.20
rev.2.168.192.in-addr.arpa
Code:
@ IN SOA ns1.x.local. admin.x.local. (
2010011001;
28800;
604800;
604800;
86400
)
IN NS ns1.x.local.
20 IN PTR x.local
resolv.conf
Code:
search x.local
nameserver 192.168.2.20
Any help would be greatly appreciated. I can't seem to figure out what I am doing wrong.
Edit: I can browse to the site by putting in the ip address of the nameserver/webhost into my browser.
Re: Howto: Setup a DNS server with bind
when i try to start bind it says bind9 rmdc:connect failed :127.0.0.1#953: connection refused
where do i start looking to trouble shoot this? any help is much appreciated
thanks!
Re: Howto: Setup a DNS server with bind
Hi,
Sorry to be resurrecting a dead thread here, but I cannot get it to work. I cannot resolve my own machine's hostname!
Here are my files:
Quote:
Originally Posted by named.conf.local
zone "communicate.local" {
type master;
file "/etc/bind/zones/communicate.local.db";
};
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
Quote:
Originally Posted by named.conf.options
options {
directory "/var/cache/bind";
forwarders {
192.168.0.1;
};
auth-nxdomain no;
listen-on-v6 { any; };
};
Quote:
Originally Posted by communicate.local.db
communicate.local. IN SOA zeus.communicate.local. admin.communicate.local. (
2006081401
28800
3600
604800
38400
)
communicate.local. IN NS zeus.communicate.local.
* IN A 192.168.0.2
zeus IN A 192.168.0.2
Quote:
Originally Posted by rev.0.168.192.in-addr.arpa
@ IN SOA zeus.communicate.local. admin.communicate.local. (
2006081401;
28800;
604800;
604800;
86400
)
IN NS zeus.communicate.local.
2 IN PTR communicate.local
2 IN PTR zeus.communicate.local
Quote:
Originally Posted by resolv.conf
nameserver 192.168.0.2
domain communicate.local
search communicate.local
bind9 starts fine, but when I try nslookup zeus 192.168.0.2, I get:
Quote:
Server: 192.168.0.2
Address: 192.168.0.2#53
** server can't find zeus: NXDOMAIN
If anybody knows what could be causing my problem, I would appreciate it if you could let me know. By the way, this happens whether I run the nslookup from the zeus itself (the DNS server) or another machine on the network.
Thanks in advance for your help,
Grakul
Re: Howto: Setup a DNS server with bind
Nevermind. I fixed it. I ran the following command:
Code:
named-checkzone example.com /etc/bind/db.example.com
It basically gave errors on each of the comment lines. I removed all the comments, after which the above line reported "OK."
I restarted bind and was able to resolve zeus and ping communicate.local.
Now to find out how to get my DHCP server to automatically update DNS for the clients.... ;)
Cheers
Grakul
Re: Howto: Setup a DNS server with bind
nice tutorial ! a want to try this !
thank's
Re: Howto: Setup a DNS server with bind
Re: Howto: Setup a DNS server with bind
how to an other domain created with this domain
Re: Howto: Setup a DNS server with bind
How would I go about setting up a CNAME record.
Directing users of the DNS Server from:
www.example.com to www.other.com
I cannot use an A record because the ip address that www.other.com is dynamic and not static.
*Note - www.example.com and www.other.com are just examples.
Thank you.
Re: Howto: Setup a DNS server with bind
Very good tutorials, still having issues, I'm using a live example here and just can't get it to work, here's my configuration so far:
I'm going to use mydomain.com as my domain name here
named.conf.local
Code:
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "mydomain.com" {
type master;
file "/etc/bind/db.mydomain.com";
};
# 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 "201.168.192.in-addr.arpa" {
type master;
file "/etc/bind/rev.201.168.192.in-addr.arpa";
};
db.mydomain.com
Code:
;
; BIND data file for mydomain.com
;
$TTL 604800
mydomain.com. IN SOA ns1.mydomain.com. admin.mydomain.com. (
84739 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ); Negative Cache TTL
;
mydomain.com. IN NS ns1.mydomain.com.
mydomain.com. 86400 IN NS ns2.mydomain.com.
localhost 14400 IN A 127.0.0.1
ns1 14400 IN A <external server IP>
ns2 14400 IN A <external server IP>
@ IN A 127.0.0.1
@ IN AAAA ::1
Any help would be appreciated.
Re: Howto: Setup a DNS server with bind
That does not works for me. The file 'example.com.db' contains:
Code:
example.com. IN SOA ns1.example.com. admin.example.com. (
2006081401
28800
3600
604800
38400
)
example.com. IN NS ns1.example.com.
example.com. IN MX 10 mail.example.com.
www IN A ***.***.***.***
mail IN A ***.***.***.***
ns1 IN A ***.***.***.***
and here is result of named-checkzone:
Code:
# named-checkzone example.com example.com.db
example.com.db:1: no TTL specified; using SOA MINTTL instead
zone example.com/IN: loaded serial 2006081401
OK
But dig resolve successfully! What is wrong?