2021-02-20 12:55:36 -05:00
|
|
|
export interface AddressTarget {
|
|
|
|
target_ip: string;
|
|
|
|
target_port?: number;
|
|
|
|
}
|
|
|
|
export interface ResolveOptions {
|
|
|
|
timeout?: number;
|
2021-03-20 11:18:05 -04:00
|
|
|
allowCache?: boolean;
|
|
|
|
maxDepth?: number;
|
|
|
|
allowSrv?: boolean;
|
|
|
|
allowCName?: boolean;
|
|
|
|
allowAny?: boolean;
|
|
|
|
allowA?: boolean;
|
|
|
|
allowAAAA?: boolean;
|
2021-02-20 12:55:36 -05:00
|
|
|
}
|
|
|
|
export declare const default_options: ResolveOptions;
|
2021-03-20 11:18:05 -04:00
|
|
|
export interface DNSResolveOptions {
|
|
|
|
timeout?: number;
|
|
|
|
allowCache?: boolean;
|
|
|
|
maxDepth?: number;
|
|
|
|
allowSrv?: boolean;
|
|
|
|
allowCName?: boolean;
|
|
|
|
allowAny?: boolean;
|
|
|
|
allowA?: boolean;
|
|
|
|
allowAAAA?: boolean;
|
|
|
|
}
|
|
|
|
export interface DNSAddress {
|
|
|
|
hostname: string;
|
|
|
|
port: number;
|
|
|
|
}
|
|
|
|
export declare type DNSResolveResult = {
|
|
|
|
status: "success";
|
|
|
|
originalAddress: DNSAddress;
|
|
|
|
resolvedAddress: DNSAddress;
|
|
|
|
} | {
|
|
|
|
status: "error";
|
|
|
|
message: string;
|
|
|
|
} | {
|
|
|
|
status: "empty-result";
|
|
|
|
};
|
|
|
|
export interface DNSProvider {
|
|
|
|
resolveAddress(address: DNSAddress, options: DNSResolveOptions): Promise<DNSResolveResult>;
|
|
|
|
resolveAddressIPv4(address: DNSAddress, options: DNSResolveOptions): Promise<DNSResolveResult>;
|
|
|
|
}
|
|
|
|
export declare function getDNSProvider(): DNSProvider;
|
|
|
|
export declare function setDNSProvider(newProvider: DNSProvider): void;
|