Package io.github.astrapi69.net.dns
Klasse DnsLookupExtensions
java.lang.Object
io.github.astrapi69.net.dns.DnsLookupExtensions
Utility class for performing DNS lookups, reverse lookups, and running external DNS commands like
nslookup and dig
-
Feldübersicht
Felder -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungresolveDomain
(String domain) Resolves a domain name using the default system DNS resolverstatic String
reverseLookup
(String ipAddress) Performs a reverse DNS lookup to find the hostname for a given IP addressstatic String
Runs the dig command for a given domain and returns the outputstatic String
runNslookup
(String domain) Runs the nslookup command for a given domain and returns the output
-
Felddetails
-
PUBLIC_DNS_SERVER_OF_GOOGLE
Public DNS server of Google- Siehe auch:
-
-
Methodendetails
-
resolveDomain
Resolves a domain name using the default system DNS resolver- Parameter:
domain
- the domain name (e.g., "google.com")- Gibt zurück:
- the resolved IP addresses
- Löst aus:
UnknownHostException
- if the domain cannot be resolved
-
reverseLookup
Performs a reverse DNS lookup to find the hostname for a given IP address- Parameter:
ipAddress
- the IP address (e.g., "8.8.8.8")- Gibt zurück:
- the resolved hostname
- Löst aus:
UnknownHostException
- if the IP address cannot be resolved
-
runNslookup
Runs the nslookup command for a given domain and returns the output- Parameter:
domain
- the domain to look up (e.g., "google.com")- Gibt zurück:
- the output of the nslookup command
- Löst aus:
IOException
- if an error occurs while executing the command
-
runDig
Runs the dig command for a given domain and returns the output- Parameter:
domain
- the domain to look up (e.g., "google.com")- Gibt zurück:
- the output of the dig command
- Löst aus:
IOException
- if an error occurs while executing the command
-