Stay organized with collections
Save and categorize content based on your preferences.
DnsException
class DnsException : Exception
Class to represent DNS error
Summary
Public constructors
Properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DnsResolver.DnsException\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDnsException\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/DnsResolver.DnsException \"View this page in Java\") \n\n```\nclass DnsException : Exception\n```\n\n|---|---|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||\n| | ↳ | [java.lang.Exception](../../java/lang/Exception.html#) ||\n| | | ↳ | [android.net.DnsResolver.DnsException](#) |\n\nClass to represent DNS error\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DnsException](#DnsException(kotlin.Int,%20kotlin.Throwable))`(`code:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `cause:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` \u003cbr /\u003e |\n\n| Properties ||\n|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [code](#code:kotlin.Int) DNS error code as one of the ERROR_\\* constants Value is [android.net.DnsResolver#ERROR_PARSE](/reference/kotlin/android/net/DnsResolver#ERROR_PARSE:kotlin.Int), or [android.net.DnsResolver#ERROR_SYSTEM](/reference/kotlin/android/net/DnsResolver#ERROR_SYSTEM:kotlin.Int) |\n\nPublic constructors\n-------------------\n\n### DnsException\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDnsException(\n code: Int, \n cause: Throwable?)\n```\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.net.DnsResolver#ERROR_PARSE](/reference/kotlin/android/net/DnsResolver#ERROR_PARSE:kotlin.Int), or [android.net.DnsResolver#ERROR_SYSTEM](/reference/kotlin/android/net/DnsResolver#ERROR_SYSTEM:kotlin.Int) |\n| `cause` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?: This value may be `null`. |\n\nProperties\n----------\n\n### code\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nval code: Int\n```\n\nDNS error code as one of the ERROR_\\* constants \nValue is [android.net.DnsResolver#ERROR_PARSE](/reference/kotlin/android/net/DnsResolver#ERROR_PARSE:kotlin.Int), or [android.net.DnsResolver#ERROR_SYSTEM](/reference/kotlin/android/net/DnsResolver#ERROR_SYSTEM:kotlin.Int)"]]