Tips for working with networks
Change system hostname
No system reboot is required
shell
hostnamectl set-hostname new-hostname
Addition: Hard reset for netip component network
shell
systemctl restart systemd-hostnamed && \
docker rm -f netip.network
and run reinstall components
Monitor network resource usage
For the interface eth0
shell
apt install tcptrack && \
tcptrack -i eth0
For port 443 only
shell
tcptrack -i eth0 port 443
Across all interfaces
shell
apt install nethogs && \
nethogs
Monitor UDP connections
shell
apt install conntrack -y && \
conntrack -L -p udp
Change DNS
Change DNS for DHCP
shell
nano /etc/dhcp/dhclient.conf
# add the following line
supersede domain-name-servers 1.1.1.1, 1.0.0.1;
# restart
systemctl restart networking.service
Hard Change DNS
If the above doesn't work, manually change it and lock the file
Change or Add
nameserver
to/etc/resolv.conf
To lock the file and restart
shell
chattr +i $(readlink -f /etc/resolv.conf) && \
systemctl restart networking.service
Rollback: To unlock the file
shell
chattr -i $(readlink -f /etc/resolv.conf) && \
systemctl restart networking.service && resolvconf -u