LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

idn

Encode and decode internationalized domain names

TLDR

Encode a Unicode domain to Punycode (ACE)
$ echo "münchen.de" | idn
copy
Decode a Punycode domain back to Unicode
$ echo "xn--mnchen-3ya.de" | idn --idna-to-unicode
copy
Encode a domain with stringprep processing
$ idn --stringprep [domain]
copy
Encode using IDNA ToASCII operation
$ idn --idna-to-ascii [example.日本]
copy
Quiet mode (suppress informational messages)
$ idn -q [domain]
copy

SYNOPSIS

idn [options] [strings...]

DESCRIPTION

idn converts internationalized domain names (IDN) between Unicode and ASCII-Compatible Encoding (ACE/Punycode). It implements the IDNA (Internationalized Domain Names in Applications) standard, allowing domain names with non-ASCII characters to be represented in the DNS system.
The encoding process applies Nameprep string preparation (case folding, normalization, prohibited character checks) before Punycode encoding. ACE-encoded labels use the xn-- prefix. The tool reads from command-line arguments or standard input when no strings are provided.

PARAMETERS

strings

Domain names to convert. Read from stdin if not provided.
--idna-to-ascii
Convert domain from Unicode to ASCII-Compatible Encoding (ACE). This is the default operation.
--idna-to-unicode
Convert domain from ACE (Punycode) back to Unicode.
--stringprep
Perform Nameprep stringprep processing on input.
--punycode-encode
Encode raw input using Punycode algorithm (without IDNA processing).
--punycode-decode
Decode raw Punycode input (without IDNA processing).
-n, --nfkc
Apply Unicode NFKC normalization.
-p profile, --profile=profile
Use specified stringprep profile (e.g., Nameprep, iSCSI, SASL).
--no-tld
Skip TLD-specific validity checks.
--usestd3asciirules
Apply STD3 ASCII rules (forbid non-LDH characters).
-q, --quiet
Suppress informational messages.
--debug
Show debug information during processing.
--help
Display help information.
--version
Display version information.

CAVEATS

This tool implements IDNA 2003 (RFC 3490). For the newer IDNA 2008 standard (RFC 5891), use idn2 from the libidn2 package. The two standards differ in handling of some characters (e.g., German eszett, Greek final sigma). Part of GNU Libidn.

HISTORY

idn is part of GNU Libidn, written by Simon Josefsson. The IDNA standard was published as RFC 3490 in 2003 to enable internationalized domain names in the DNS.

SEE ALSO

host(1), dig(1)

Copied to clipboard
Kai