node-email-mx-checker
Version:
A Node.js library to check MX records for domains
30 lines (28 loc) • 741 B
TypeScript
import { default as dns, resolveMx } from 'dns';
export declare const dnsResolveMx: typeof resolveMx.__promisify__;
/**
* MX check result
*/
export interface MxCheckResult {
domain: string;
hasMx: boolean;
mxRecords?: dns.MxRecord[];
error?: string;
}
/**
* Options for MX checking
*/
export interface MxCheckOptions {
/**
* Timeout in milliseconds for DNS lookups
* @default 5000
*/
timeout?: number;
}
/**
* Checks if a domain has MX records and returns the list of MX records
* @param domain Domain to check
* @param options Check options
* @returns Promise resolving to MX check result
*/
export declare function checkMx(domain: string, options?: MxCheckOptions): Promise<MxCheckResult>;