Home / route and netstat commands are slow in listing the routing table

route and netstat commands are slow in listing the routing table

Instead, use the ip route, route -n, or netstat -rn commands. Contact the DNS server administrator to find out why queries are taking so long.

The DNS server takes almost 10 seconds to return a reverse name lookup on the gateway, as seen in the output of dig.

Query time: 8880 msec

Time the commands in the routing table, both with and without name resolution.

# time route -n
real 0m0.031s
user 0m0.001s
sys 0m0.000s
# time route
real 0m47.377s
user 0m0.001s
sys 0m0.001s

Time the DNS server.

# dig @<DNS server IP> -x <default gateway IP>
; <<>> DiG 9.3.6-P1-Centos-9.3.6-16.P1.el5 <<>> @<DNS server IP> -x <default gateway IP>
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 17443
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;<reverse gateway IP>.in-addr.arpa. IN PTR

;; Query time: 9839 msec
;; SERVER: <DNS server IP>#53(<DNS server IP>)
;; WHEN: Wed Dec 12 11:31:52 2012
;; MSG SIZE rcvd: 42

Leave a Reply