: Class DNSClient

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.dalsemi.tininet.dns
Class DNSClient

    java.lang.Object
      |
      +--com.dalsemi.tininet.dns.DNSClient

public class DNSClient
extends Object

The `DNSClient` class allows DNS (Domain Name System) lookups per RFC 1035. Can perform forward or reverse lookups.

Constructor Summary
`DNSClient()` Create an instance of `DNSClient`.

Method Summary
`String[]` | `getByIP(byte[] ip)` Performs a reverse DNS lookup.
`String[]` | `getByIP(String ip)` Performs a reverse DNS lookup.
`String[]` | `getByName(String name)` Performs a DNS lookup.
`void` | `setDNSTimeout(int timeout)` Sets the DNS timeout.
`void` | `setPrimaryDNS(String dns1)` Sets the primary DNS server to use for resolution.
`void` | `setSecondaryDNS(String dns2)` Sets the secondary DNS server to use for resolution.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DNSClient

    public DNSClient()

  Create an instance of `DNSClient`.

Method Detail

### setDNSTimeout

    public void setDNSTimeout(int timeout)

  Sets the DNS timeout.
  Parameters:
    `timeout` - Set to 0 for exponential backoff timeout or non-zero value for single timeout in milliseconds.

### setPrimaryDNS

    public void setPrimaryDNS(String dns1)

  Sets the primary DNS server to use for resolution.
  Note: Address must be in numerical IP format
  Parameters:
    `dns1` - IP address of DNS Server

### setSecondaryDNS

    public void setSecondaryDNS(String dns2)

  Sets the secondary DNS server to use for resolution.
  Note: Address must be in numerical IP format
  Parameters:
    `dns2` - IP address of DNS Server

### getByIP

    public String[] getByIP(String ip)

  Performs a reverse DNS lookup.
  Parameters:
    `ip` - Address to look up
  Returns:
    DNS response, or `null` for failed lookup

### getByIP

    public String[] getByIP(byte[] ip)

  Performs a reverse DNS lookup.
  Parameters:
    `ip` - Address to look up
  Returns:
    DNS response, or `null` for failed lookup

### getByName

    public String[] getByName(String name)

  Performs a DNS lookup.
  Parameters:
    `name` - FQDN to look up
  Returns:
    DNS response, or `null` for failed lookup

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD