com.mysql.cj.util

## Class DnsSrv

- java.lang.Object
- - com.mysql.cj.util.DnsSrv

    public class DnsSrv
    extends Object

### Nested Class Summary

Nested Classes
`static class` `DnsSrv.SrvRecord`

### Constructor Summary

Constructors
Constructor and Description
`DnsSrv()`

### Method Summary

All Methods Static Methods Concrete Methods
`static List<DnsSrv.SrvRecord>` `lookupSrvRecords(String serviceName)`
`static List<DnsSrv.SrvRecord>` `sortSrvRecords(List<DnsSrv.SrvRecord> srvRecords)` Sort a list of DNS SRV records according to the sorting rules described in rfc2782.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DnsSrv

    public DnsSrv()

### Method Detail

#### lookupSrvRecords

    public static List<DnsSrv.SrvRecord> lookupSrvRecords(String serviceName)
                                                   throws NamingException

Throws:
  `NamingException`

#### sortSrvRecords

    public static List<DnsSrv.SrvRecord> sortSrvRecords(List<DnsSrv.SrvRecord> srvRecords)

Sort a list of DNS SRV records according to the sorting rules described in rfc2782.

Parameters:
  `srvRecords` - the list of `DnsSrv.SrvRecord`s to sort.
Returns:
  a new list of sorted `DnsSrv.SrvRecord`s.

Copyright © 2016, 2025, Oracle and/or its affiliates.