nsupdate is only working for cnames. It seems the apex (A record for the root domain) is not updating. I have been able to add to the zone file by using "update add . 604800 A 1.1.1.1" but it puts it in the "$ORIGIN ." section of the zone file and I am unable to delete and update it. I have tried "update add . 604800 A 2.2.2.2" but no update happens. I also tried "update add example.com. 604800 A 2.2.2.2". I have placed a place holder record in the "$ORIGIN ." and the "$ORIGIN example.com." section of the zone file thinking it needs to find it to update it. I have tried deleting it and updating it also... nothing seems to work. I read somewhere that bind cant write to /etc/bind/zones so I put the zone file in /var/lib/bind. Bind has written to the file, but only once to put in a record in the "$ORIGIN ." section. Any advice?
My Zone file:
$ORIGIN .
$TTL 604800 ; 1 week
example.com. IN SOA ns1.example.com. admin.ns1.example.com. (
24 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
604800 ; minimum (1 week)
)
NS ns1.example.com.
NS ns2.example.com.
$ORIGIN example.com
@ A 5.5.5.5
ds1512 A 10.0.0.13
ds1817 A 10.0.0.14
home CNAME ds1817
ns1 A 10.0.0.6
ns2 A 10.0.0.3
roma CNAME ds1817
www CNAME example.com.
My commands with debug output:
brent@dnsdhcpserver:/var/lib/bind$ sudo nsupdate -d
> server 10.0.0.6
> zone example.com
> update delete @ A
> update add @ 604800 A 2.2.2.2
> send
Sending update to 10.0.0.6#53
Outgoing update query:
;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: 25996
;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 2, ADDITIONAL: 0
;; ZONE SECTION:
;example.com. IN SOA
;; UPDATE SECTION:
. 0 ANY A
. 604800 IN A 172.16.1.10
Reply from update query:
;; ->>HEADER<<- opcode: UPDATE, status: NOTZONE, id: 25996
;; flags: qr; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
;; ZONE SECTION:
;example.com. IN SOA
That didn't work so I tried:
> server 10.0.0.6
> prereq nxdomain example.com
> update add example.com. 604800 A 2.2.2.2
> send
Reply from SOA query:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47462
;; flags: qr aa ra; QUESTION: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;example.com. IN SOA
;; ANSWER SECTION:
example.com. 604800 IN SOA ns1.example.com. admin.ns1.example.com. 24 604800 86400 2419200 604800
;; AUTHORITY SECTION:
example.com. 604800 IN NS ns2.example.com.
example.com. 604800 IN NS ns1.example.com.
;; ADDITIONAL SECTION:
ns1.example.com. 604800 IN A 10.0.0.6
ns2.example.com. 604800 IN A 10.0.0.3
Found zone name: example.com
The master is: ns1.example.com
Sending update to 10.0.0.6#53
Outgoing update query:
;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: 8484
;; flags:; ZONE: 1, PREREQ: 1, UPDATE: 1, ADDITIONAL: 0
;; PREREQUISITE SECTION:
example.com. 0 NONE ANY
;; UPDATE SECTION:
example.com. 604800 IN A 172.16.1.11
Reply from update query:
;; ->>HEADER<<- opcode: UPDATE, status: YXDOMAIN, id: 8484
;; flags: qr; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
;; ZONE SECTION:
;example.com. IN SOA
Can anyone see what I am missing?