Monday, December 26, 2016

domain name system - What am I doing wrong with bind9?

I am trying to bind a domain name to a vps but I am failing..



I get this when I dig:



; <<>> DiG 9.10.3-P4-Ubuntu <<>> ns1.example.com @61.15.2.95
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49520
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; WARNING: recursion requested but not available


;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ns1.example.com. IN A

;; ANSWER SECTION:
ns1.example.com. 604800 IN A 61.15.2.95

;; AUTHORITY SECTION:

example.com. 604800 IN NS ns2.example.com.
example.com. 604800 IN NS ns1.example.com.

;; ADDITIONAL SECTION:
ns2.example.com. 604800 IN A 178.159.2.95

;; Query time: 314 msec
;; SERVER: 178.159.2.95#53(178.159.2.95)
;; WHEN: Sat Apr 15 14:26:22 +04 2017
;; MSG SIZE rcvd: 106



Problem
;; WARNING: recursion requested but not available
since it is just a warning I tried to register it at quickhostuk but I got this error at dns management:



Failed to Modify Domain Nameservers: Nameserver not found at registry


here is what I did..




say, my vps IP is: 61.15.2.95
domain name: example.com
name servers:




  • ns1.example.com=>61.15.2.95

  • ns2.example.com =>61.15.2.95



1.I installed bind9.




2.I created a zone in named.conf.local



zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};


3. I created a db file for db.example.com




;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.example.com. root.ns1.example.com. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL

;
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
@ IN A 61.15.2.95
ns1 IN A 61.15.2.95
ns2 IN A 61.15.2.95


4.I modified named.conf.options and I added my vps ip to forwarders, I also tried google's 8.8.8.8 and 8.8.4.4




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 {
61.15.2.95;
};


//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys

//========================================================================
dnssec-validation auto;

auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};


How should I correctly put it all together to make it work?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...