nsIDNSService
| IID: | 3ac9e611-e6b6-44b5-b312-c040e65b2929 |
| Inherits From: | nsISupports |
This interface is intended to be used as a service. To create an object implementing this interface:
var obj = Components.classes["@mozilla.org/network/dns-service;1"].
getService(Components.interfaces.nsIDNSService);This interface is implemented by the following components:
Constants
| If set, this flag suppresses the internal DNS lookup cache. | ||
| PRUint32 | RESOLVE_BYPASS_CACHE | = 1 |
| If set, the canonical name of the specified host will be queried. | ||
| PRUint32 | RESOLVE_CANONICAL_NAME | = 2 |
Properties
readonly AUTF8String myHostName
Methods
nsICancelable asyncResolve ( AUTF8String hostName , PRUint32 flags , nsIDNSListener listener , nsIEventTarget listenerTarget )
nsIDNSRecord resolve ( AUTF8String hostName , PRUint32 flags )
nsICancelable asyncResolve ( AUTF8String hostName , PRUint32 flags , nsIDNSListener listener , nsIEventTarget listenerTarget )
Kicks off an asynchronous host lookup.
- Arguments:
- hostName: the hostname or IP-address-literal to resolve.
- flags: a bitwise OR of the RESOLVE_ prefixed constants defined below.
- listener: the listener to be notified when the result is available.
- listenerTarget: optional parameter (may be null). if non-null, this parameter specifies the nsIEventTarget of the thread on which the listener's onLookupComplete should be called. however, if this parameter is null, then onLookupComplete will be called on an unspecified thread (possibly recursively).
- Returns:
- An object that can be used to cancel the host lookup.
nsIDNSRecord resolve ( AUTF8String hostName , PRUint32 flags )
Called to synchronously resolve a hostname. warning this method may block the calling thread for a long period of time. it is extremely unwise to call this function on the UI thread of an application.
- Arguments:
- hostName: the hostname or IP-address-literal to resolve.
- flags: a bitwise OR of the RESOLVE_ prefixed constants defined below.
- Returns:
- DNS record corresponding to the given hostname.
Reference documentation is generated from Mozilla's source.
