"host" command fails to resolve hostnames containing non-ASCII characters when executed non-interactively

Solution Verified - Updated -

Issue

  • When executing host command as part of a script or a service, i.e. in a non-interactive shell context, the hostnames containing non-ASCII characters cannot be resolved, e.g.

    $ crontab -e
    * * * * * host www.tribunal-fédéral.ch > /tmp/host.out 
    
    $ sleep 60
    $ cat /tmp/host.out
    Host www.tribunal-fédéral.ch not found: 3(NXDOMAIN)
    
  • The issue also occurs when piping the output while executing the command in an interactive shell, e.g.

    $ host www.tribunal-fédéral.ch | tee /tmp/host.out
    Host www.tribunal-fédéral.ch not found: 3(NXDOMAIN)
    

Environment

  • Red Hat Enterprise Linux 8 and 9

    • host (bind-utils)
  • Fedora 40

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content