@multiformats/dns
    Preparing search index...

    Interface DNSInit

    interface DNSInit {
        cacheSize?: number;
        logger?: ComponentLogger;
        resolvers?: DNSResolvers;
    }
    Index

    Properties

    cacheSize?: number

    To avoid repeating DNS lookups, successful answers are cached according to their TTL. To avoid exhausting memory, this option controls how many answers to cache.

    1000
    

    An optional logger

    resolvers?: DNSResolvers

    A set of resolvers used to answer DNS queries

    String keys control which resolvers are used for which TLDs.

    import { dns } from '@multiformats/dns'
    import { dnsOverHttps } from '@multiformats/dns'

    const resolver = dns({
    resolvers: {
    // only used for .com domains
    'com.': dnsOverHttps('https://example-1.com'),

    // only used for .net domains, can be an array
    'net.': [
    dnsOverHttps('https://example-2.com'),
    dnsOverHttps('https://example-3.com'),
    ],

    // used for everything else (can be an array)
    '.': dnsOverHttps('https://example-4.com')
    }
    })