西维蜀黍

【Linux】记录所有 DNS 查询

[Recommend] Via DNS Sniffer

# If ubuntu
$ sudo apt-get install python3-scapy; 
# If OpenWrt
$ opkg install scapy
# If macOS
$ brew install libpcap; sudo pip3 install scapy -i https://pypi.python.org/simple

$ git clone git@github.com:Oros42/DNS_sniffer.git; cd DNS_sniffer

# For a specific interface
$ sudo python3 dns_sniffer.py -i eth0

# Write to a DB
$ sudo python3 dns_sniffer.py -i en0 -d db.sqlite

Demo

在一个 session运行

$ dig google.com

...

这次 DNS query即可被捕捉到

$ sudo python3 dns_sniffer.py -i tun0
IP source       | DNS server      | Count DNS request | Query
10.22.56.25
                  8.8.8.8
                                    1                   google.com.

Ref

  ...


【Linux】搭建 DNS Server

  ...


【MySQL】MySQL Exporter

Download

$ curl -LO https://github.com/prometheus/mysqld_exporter/releases/download/v0.14.0/mysqld_exporter-0.14.0.linux-amd64.tar.gz

$ tar xf mysqld_exporter-0.14.0.linux-amd64.tar.gz
  ...


【Linux】snap

Service Management

List

# Display basic information about installed snap software
$ snap list

# Check for recent snap changes in the system
$ snap changes

Install

# Search for a package
$ snap find package_name

# Install a package
$ snap install package_name

Update

# Update a package
$ snap refresh package_name

# Update a package to another channel (track, risk, or branch)
$ snap refresh package_name --channel=channel

# Update all packages
$ snap refresh

Uninstall

# Uninstall a package
$ snap remove package_name
  ...


【Network】V2Ray

Install

Server

Linux

安装和更新 V2Ray

// 安装可执行文件和 .dat 数据文件
$ curl -LO https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh; sudo bash install-release.sh

$ sudo systemctl enable v2ray; sudo systemctl start v2ray

Refer to https://github.com/v2fly/fhs-install-v2ray/blob/master/README.zh-Hans-CN.md

  ...