Javascript DNS
From Yate Documentation
				
								
				(Difference between revisions)
				
																
				
				
								
				 (→Methods)  | 
			 (Added resolve() and local())  | 
			||
| Line 49: | Line 49: | ||
* '''querySrv(name,async)'''  | * '''querySrv(name,async)'''  | ||
Shortcut for ''query("SRV",name,async)''  | Shortcut for ''query("SRV",name,async)''  | ||
| + | |||
| + | |||
| + | * '''resolve(name)'''  | ||
| + | Resolves the ''name'' using the system routines. This returns at most one address and takes into account the hosts file.  | ||
| + | |||
| + | |||
| + | * '''local(address)'''  | ||
| + | Returns the local IP address that is used by default as route to remote ''address''. Remote address can be specified by DNS name in which case it is resolved first.  | ||
Revision as of 05:47, 27 August 2014
DNS resolver global object.
Methods
- query(type,name,async)
 
Make a DNS query
Parameters:
type Type of DNS Record to query
name Domain Name to query
async Optional non-blocking flag
Return:
Array of records of uniform type.
- For A, AAAA, TXT records are strings
 -  For NAPTR records are objects with fields:
- flags
 - service
 - regexp
 - replacement
 - name
 - order
 - priority
 - ttl
 
 -  For SRV records are objects with fields:
- port
 - name
 - order
 - priority
 - ttl
 
 
If async is boolean true the execution context is unlocked during the DNS operation.
- queryA(name,async)
 
Shortcut for query("A",name,async)
- queryAaaa(name,async)
 
Shortcut for query("AAAA",name,async)
- queryTxt(name,async)
 
Shortcut for query("TXT",name,async)
- queryNaptr(name,async)
 
Shortcut for query("NAPTR",name,async)
- querySrv(name,async)
 
Shortcut for query("SRV",name,async)
- resolve(name)
 
Resolves the name using the system routines. This returns at most one address and takes into account the hosts file.
- local(address)
 
Returns the local IP address that is used by default as route to remote address. Remote address can be specified by DNS name in which case it is resolved first.