Setting Prerequisites in a Dynamic Update

5.22.1 Problem

You want to set a prerequisite in a dynamic update.

5.22.2 Solution

Use nsupdate and specify the prerequisite you want as an argument to the prereq command. Then specify the update with an update command. nsupdate supports the following kinds of prerequisites:


The following domain name doesn't exist.


The following domain name exists.


The following domain name doesn't own records of the specified type.


The following domain name owns records of the specified type. If the RDATA is specified, it must match, too.

For example, you could use this nsupdate command to add an A record to foo.example only if foo.example doesn't already have an A record:

$ nsupdate
> prereq nxrrset foo.example A
> update add foo.example. 3600 A
> send

In order to change's A record to only if it's currently, you could use:

$ nsupdate
> prereq yxrrset A
> update delete A
> update add 3600 A
> send

5.22.3 Discussion

Remember that the BIND 8 version of nsupdate doesn't support the send command. Instead, just type a blank line.

5.22.4 See Also

nsupdate(8) and "DNS Dynamic Update" in Chapter 10 of DNS and BIND.

Getting Started

Zone Data

BIND Name Server Configuration

Electronic Mail

BIND Name Server Operations

Delegation and Registration


Interoperability and Upgrading

Resolvers and Programming

Logging and Troubleshooting


DNS & BIND Cookbook
DNS & BIND Cookbook
ISBN: 0596004109
EAN: 2147483647
Year: 2005
Pages: 220
Authors: Cricket Liu © 2008-2020.
If you may any questions please contact us: