This module provides a couple of simple utilities to deal with
the access to internationalized domain names (IDNs). The predicate
make_domain/3 allows constructing and deconstructing user and
host. The predicate works bidirectional without loss of data.
?- make_domain('foo','λ.com',X). X = 'foo@λ.com'
The predicate host_lookup/2 can be used to perform a forward or reverse lookup of a host name. The predicate will fail if the host name is not known. The predicate ping_host/1 can be used to check the reachability of a host name. The Java internet libraries do not automatically a name preparation. Neither do our Prolog predicates presented so far.Example:
?- uri_puny('http://zürich.ch/robots.txt', X). X = 'http://xn--zrich-kva.ch/robots.txt'
Name preparation is for example required for host names. Domain name servers only work with ASCII represented host names and the recommended encoding of Unicode towards ASCII for host names is puny code. Such an encoding can be invoked by the predicate uri_puny/2 provided in this module.
The following domain predicates are provided: