CoDoNS servers are layered on top of Pastry and Beehive. Each CoDoNS server implements a complete, recursive, caching DNS resolver and supports all requirements described in the specification [25,26]. CoDoNS also supports inverse queries that map IP addresses to a domain name by inserting reverse address-name records into the DHT when name-address records are introduced.
Domain names in CoDoNS have unique 128 bit identifiers obtained through the SHA-1 hashing algorithm. The home node, the closest node in the identifier space, stores permanent copies of the resource records of the domain name and maintains their consistency in the system. Since CoDoNS does not associate TTLs with the records, the home nodes push the updates to all replicas in the system, which retain them until the replication level of the record is downgraded, or until an update is received. Nameowners insert updated resource records into CoDoNS, and the home nodes proactively propagate the updates.
CoDoNS ensure the consistency of records obtained from the legacy DNS, CoDoNS by proactively refetching them. The home node uses the TTL specified by the legacy DNS as the duration to store the records. It refetches the records from legacy DNS after TTL duration, and propagates the updated records to all the replicas if the records change. Since CoDoNS performs the refetches in the background, its lookup performance is not affected. The TTL values are rounded up to a minimum of thirty seconds; records with lower TTL values are not placed into the system. Low TTL values typically indicate dynamic server-selection in legacy DNS. The home node prompts the server that injected the query to consult the legacy DNS server by issuing a special error-response. This redirection of queries for low-TTL records ensures that services that rely on dynamic server selection will continue to work, and reduces overhead on the CoDoNS home nodes.
The legacy DNS relies on error responses, called NXDOMAIN responses, to detect names that do not exist. Since clients reissue a request several times when they do not receive prompt replies, the DNS specification recommends that resolvers cache NXDOMAIN responses. CoDoNS provides complete support for negative caching as described in . However, permanently storing NXDOMAIN responses could exhaust the capacity of the system, since an unlimited number of queries can be generated for non-existent domains. Hence, CoDoNS nodes cache NXDOMAIN responses temporarily and do not refresh them upon expiry.