OS/CentOS

dnsmasq 설치 후 질의 통계 확인 하기

Dragonfog.net 2023. 1. 16. 13:26
반응형

아래와 같이 pkill 을 사용하여 USR1시그널을dnsmasq로전달하면 통계정보를 dump 할수 있다
pkill -USR1 dnsmasq
/var/log/dnsmasq.log 에서 확인 가능

Jan 16 13:10:24 dnsmasq[24931]: time 1673842224
Jan 16 13:10:24 dnsmasq[24931]: cache size 500, 0/0 cache insertions re-used unexpired cache entries.  (캐쉬 사이즈)
Jan 16 13:10:24 dnsmasq[24931]: queries forwarded 0, queries answered locally 4  (로컬에서 등답 횟수)
Jan 16 13:10:24 dnsmasq[24931]: queries for authoritative zones 0
Jan 16 13:10:24 dnsmasq[24931]: server 1.1.1.1 #53: queries sent 0, retried or failed 0  (전역 DNS 전달 회수 및 실패횟수)

 

추가로 dig 를 사용하여 정보를 확인 가능

 

## DNS Cache Statistics ##
==============================================

# DNS cache insertions
dig +short chaos txt insertions.bind

# unexpired cache entry
dig +short chaos txt evictions.bind

# cache size
dig +short chaos txt cachesize.bind

# queries forwarded (
dig +short chaos txt misses.bind

# queries answered locally (로컬응답)
dig +short chaos txt hits.bind

 

 

위 통계 정보는 dnsmasq 재기동시 모두 초기화 된다.

반응형