idn
Convert domain names between encodings
SYNOPSIS
idn [OPTION]... [NAME]...
PARAMETERS
--help
Display help and exit
--version
Output version information and exit
--quiet
Omit progress indicator
--verbose
Display more processing information
--locale=LOCALE
Set locale for output encoding (default: UTF-8)
--allow-unsigned
Allow unsigned Nameprep profiles
--nfc
Normalize to NFC before processing
--nfd
Normalize to NFD before processing
--punycode-encode
Encode NAME to Punycode
--punycode-decode
Decode NAME from Punycode
--uscore
Treat underscores as valid labels
DESCRIPTION
The idn command handles Internationalized Domain Names (IDNs) by converting between Unicode/local encoding and their ASCII-Compatible Encoding (ACE) form using Punycode. IDNs allow non-ASCII characters in domain names (e.g., café.com or bücher.example), but DNS requires ASCII, so Punycode encodes them as xn-- prefixed strings.
idn prepares input with Nameprep (normalizing and mapping Unicode), then applies IDNA encoding/decoding. By default, it encodes if input has non-ASCII, decodes if Punycode-like.
Key uses: validating IDNs for tools like browsers or resolvers; scripting domain checks; troubleshooting DNS with international characters. It supports locale-specific display and NFC/NFD normalization. Installed via libidn or idnkit packages.
Note: Primarily for IDNA 2003 spec; modern apps favor IDNA 2008 via idn2. Output assumes UTF-8 unless locale set.
CAVEATS
Deprecated in favor of idn2(1) (IDNA2008); may fail on newer IDNA rules. Assumes UTF-8 input/output; specify --locale for others. Not for TLD validation.
EXAMPLES
idn münchen.de
→ münchen.de → xn--mnchen-3ya.de
idn --punycode-decode xn--bcher-kva.de
→ bücher.de
EXIT STATUS
0 on success, 1 on invalid input/encoding error, 2 on usage error.
HISTORY
Developed as part of Idnkit by JPNIC (2000s) for IDNA2003; integrated into libidn. Superseded by GNU libidn2/idn2 for IDNA2008 compliance since ~2017.


