import * as plugins from '../plugins.js';
import type { DcRouter } from '../classes.dcrouter.js';
/**
 * Sets up and feeds the embedded authoritative smartdns server: validates the
 * DNS configuration, generates authoritative/email/DKIM records, applies
 * proxy-IP replacement, registers record handlers, wires rate-limited query
 * logging/metrics, and provides the DoH socket handler for SmartProxy routes.
 */
export declare class DnsServerRuntime {
    private dcRouterRef;
    private logWindowSecond;
    private logWindowCount;
    private batchCount;
    private batchTimer;
    constructor(dcRouterRef: DcRouter);
    /**
     * Create the DNS server, start it on UDP, wire metrics/logging, and
     * register all generated records.
     */
    setup(): Promise<void>;
    /**
     * Create the DoH socket handler SmartProxy routes hand TLS sockets to.
     */
    createSocketHandler(): (socket: plugins.net.Socket) => Promise<void>;
    /** Flush the pending rate-limited query-log batch and reset logging state. */
    flushQueryLogBatch(): void;
    private registerRecords;
    private parseRecordData;
    private validateConfiguration;
    private generateEmailDnsRecords;
    private loadDkimRecords;
    private initializeDkimForEmailDomains;
    private generateAuthoritativeRecords;
    private extractDomain;
    private applyProxyIpReplacement;
    private detectServerPublicIp;
}
