# NO\_PURGE

`NO_PURGE` indicates that existing records should not be deleted from a domain. Records will be added and updated, but not removed.

Suppose a domain is managed by both DNSControl and a third-party system. This creates a problem because DNSControl will try to delete records inserted by the other system.

By setting `NO_PURGE` on a domain, this tells DNSControl not to delete the records found in the domain.

It is similar to [`IGNORE`](/~/revisions/Uy3v06HuP9Hvf4EPf9c7/language-reference/domain-modifiers/ignore.md) but more general.

The original reason for `NO_PURGE` was that a legacy system was adopting DNSControl. Previously the domain was managed via Microsoft DNS Server's GUI. ActiveDirectory was in use, so various records were being inserted behind the scenes. It was decided to use DNSControl to simply insert a few records. The `NO_PURGE` setting instructed DNSControl not to delete the existing records.

In this example DNSControl will insert "foo.example.com" into the zone, but otherwise leave the zone alone. Changes to "foo"'s IP address will update the record. Removing the A("foo", ...) record from DNSControl will leave the record in place.

{% code title="dnsconfig.js" %}

```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), NO_PURGE,
  A("foo","1.2.3.4"),
);
```

{% endcode %}

The main caveat of `NO_PURGE` is that intentionally deleting records becomes more difficult. Suppose a `NO_PURGE` zone has an record such as A("ken", "1.2.3.4"). Removing the record from `dnsconfig.js` will not delete "ken" from the domain. DNSControl has no way of knowing the record was deleted from the file The DNS record must be removed manually. Users of `NO_PURGE` are prone to finding themselves with an accumulation of orphaned DNS records. That's easy to fix for a small zone but can be a big mess for large zones.

### Support

Prior to DNSControl v4.0.0, not all providers supported `NO_PURGE`.

With introduction of `diff2` algorithm (enabled by default in v4.0.0), `NO_PURGE` works with all providers.

### See also

* [`PURGE`](/~/revisions/Uy3v06HuP9Hvf4EPf9c7/language-reference/domain-modifiers/purge.md) is the default, thus this command is a no-op
* [`IGNORE`](/~/revisions/Uy3v06HuP9Hvf4EPf9c7/language-reference/domain-modifiers/ignore.md) is similar to `NO_PURGE` but is more selective


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dnscontrol.org/~/revisions/Uy3v06HuP9Hvf4EPf9c7/language-reference/domain-modifiers/no_purge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
