Set a static IP for Debian

For all my Proxmox LXC/VMs I always try to set a static IP so I can remember services more easily, each time I have to reach out to the AI of the month to ask the same questions, so I'm going to make it simple for myself...

Edit interfaces file: /etc/networks/interfaces.

iface ens18 inet static
    address 10.0.1.100
    subnet 255.255.255.0
    gateway 10.0.1.1
    dns-servers 10.0.1.1

For some reason, no matter the DNS servers I use, it doesn't resolve a domain name, only an IP address, so I have to also edit /etc/resolv.conf

nameserver 10.0.1.1
nameserver 1.1.1.1

At the end I either restart networking or reboot the VM/LXC

systemctl restart networking