@VisibleForTesting
  static DNSEntry readDNSEntry(final String serialized) {
    final String record = trimQuotes(serialized);
    final String prefix = getPrefix(record);
    try {
      switch (prefix) {
        case "enrtree-root":
          return new ENRTreeRoot(readKV(record));
        case "enrtree-branch":
          return new DNSEntry.ENRTree(record.substring(prefix.length() + 1));
        case "enr":
          return ENRNode.fromAttrs(readKV(record));
        case "enrtree":
          return new ENRTreeLink(record);
      }
      LOG.error("{} should contain enrtree-branch, enr, enrtree-root or enrtree", serialized);
    } catch (Throwable t) {
      LOG.warn("Failed to parse record: {}", record);
    }
    return null;
  }
Read a DNS entry from a String.

@param serialized the serialized form of a DNS entry
@return DNS entry if found
@throws IllegalArgumentException if the record cannot be read
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/dns/DNSResolver.java