iptables - Disable DNS resolution (-n --numeric)
                
            
            
            
             
            
            
                           
                
            
            
            
                
    
    
     
            
                
                    by
                    Jeremy Canfield  |  
                    Updated: November 15 2021
                    
                          |  iptables articles
                    
                    
                    
                
            
            By default, iptables will display protocols, not ports. For example, let's say a rule has been added to allow connections on HTTP port 80. iptables will list HTTP, not port 80.
~]# iptables --list
Chain INPUT (policy ACCEPT 110 packets, 9880 bytes)
 target     prot opt     source              destination
ACCEPT     all  --      anywhere             172.17.0.3  tcp dpt:http
The -n or --numeric option can be used to disable DNS resolutions, so that the ports are listed, not the protocol. Likewise, notice the source now lists 0.0.0.0/0 instead of "anywhere".
~]# iptables --list --numeric
Chain INPUT (policy ACCEPT 110 packets, 9880 bytes)
 target     prot opt     source              destination
ACCEPT     all  --       0.0.0.0./0          172.17.0.3  tcp dpt:80
            
            Did you find this article helpful?
If so, consider buying me a coffee over at 