edit the file /etc/network/interfaces starting at the iface line below the "primary network interface" to look similar to the following:
im using enp0s5 as the example interface and made up IP's, but other interfaces will likely be named differently so dont change it to the example im using
iface enp0s5 inet static
address 10.10.10.10
netmask 255.255.255.0
gateway 10.10.10.1
you can add lines for dns-nameservers, but its better to just edit the resolv.conf file and add any dns servers there. not all configs look alike, but generally you can edit the resolv.conf like so nano /etc/resolv.conf and edit it to look like the example below
nameserver IPADDRESS
if you would like multiple dns servers the add each on a new line
nameserver IPADDRESS
nameserver IPADDRESS
check whether a specific port is listening
lsof -i:PORT
check if a port is open
nc -zv IP PORT
nc -zv 127.0.0.1 PORT -- to check locally
for PORT, multiple ports can be specified e.g.
nc -zv IP 80 443ornc -zv IP 80-82
dig google.com -- this will use all name servers added to resolv.conf one by onedig google.com@DNSIP -- this will use the dns server being specified via IP