I have Kali Linux configured with a static IP address. Detailed version information is shown below.
I cannot resolve hostnames. If I put nameserver IP addresses in /etc/resolv.conf, they get lost because that file (actually, the linked file /etc/resolv.conf points to) gets deleted on boot (even though resolvconf is not installed, as shown below). If I add nameserver IP addresses to /etc/network/interfaces via the "dns-nameservers" keyword, it seems they are simply ignored.
How may I properly configure name resolution services?
root@myHostname:~# uname -a
Linux myHostname 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) x86_64 GNU/Linux
root@myHostname:~# cat /etc/debian_version
Kali Linux Rolling
root@myHostname:~# ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 35 Jul 15 18:32 /etc/resolv.conf -> /var/run/NetworkManager/resolv.conf
root@myHostname:~# ls -l /var/run/NetworkManager/resolv.conf
ls: cannot access '/var/run/NetworkManager/resolv.conf': No such file or directory
root@myHostname:~# dpkg --list | grep resolvconf
root@myHostname:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 172.25.100.2
netmask 255.255.255.0
gateway 172.25.100.1
dns-search example.com
dns-nameservers 8.8.8.8
auto eth1
iface eth1 inet static
address 192.168.101.2
netmask 255.255.255.0
root@myHostname:~# nslookup example.com
;; connection timed out; no servers could be reached
eth0
oreth1
? Are you sure you are configuring the correct NIC you are going out to the Internet from on that machine?/etc/resolv.conf
links to/run/NetworkManager/resolv.conf
. On yours doesresolv.conf
exist in/run/NetworkManager
? If so you should try adding your nameservers there and changing the/etc/resolv.conf
softlink.