Dart
Dart
DNS Lookup
Do a DNS lookup to resolve a hostname to an IP address.Chilkat Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
final socket = CkSocket();
final maxWaitMs = 10000;
final String ipAddr;
try {
ipAddr = socket.dnsLookup('www.chilkatsoft.com', maxWaitMs);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
print('IP Address: $ipAddr');
}