How to disable `iptables` automatic reverse DNS lookup?

7,801

This is mentioned in the iptables(8) manual page:

       -n, --numeric
              Numeric output.  IP addresses and port numbers will be printed in numeric
              format.  By default, the program will try to display them as host  names,
              network names, or services (whenever applicable).

This "new" feature, as well as the manual page note, have been present since at least 2000.

That said, for actually diagnosing iptables rules, you might find -S a bit more useful, as it shows the ruleset exactly as it was entered, instead of converting to a completely different layout.

Share:
7,801

Related videos on Youtube

user69874
Author by

user69874

Updated on September 18, 2022

Comments

  • user69874
    user69874 over 1 year

    It's a new "feature" added recently to iptables that whenever one lists iptables -L the IP addresses will be replaced by a domain name from reverse DNS. It's really annoying especially when I'm diagnosing a network issue and it just hangs because, well, there's no network. Is there a command line option to disable that, or even a patch?

    Searching Google didn't help, since there is a related and vastly more popular topic(how to block DNS; redirect DNS; firewall rules for a DNS server etc.)