PDA

View Full Version : DNS does not change !!



oussama
2020-01-17, 09:54
hello everybody, i want to change my DNS
actualy it is 192.168.1.1
i want to add two other dns
i tried to edit /etc/dhcp/dhclient.conf with nano and i have removed the hashtag on the line prepend domain-name-server and i have removed the 192.168.1.1 and i added two DNSs and i have saved the file
but after restaring the network service and run the commande cat /etc/resolv.conf
the is no changes..
can anyone help me please

wolfbird
2020-01-27, 19:48
I am also having issues changing the DNS on Kali 2019.4. This method worked on previous versions of Kali but, doesn't seem to be working anymore.# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 208.67.222.222
# nano /etc/dhcp/dhclient.conf
add in "prepend domain-name-servers 8.8.4.4, 1.1.1.1;"
# service network-manager restart
# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 208.67.222.222
I would expect the results to give me...
nameserver 8.8.4.4
nameserver 1.1.1.1
nameserver 8.8.8.8
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognised.
nameserver 208.67.222.222
I have seen a few others that have had this issue but nothing in regards to a fix. I think as work around I could just edit the resolver.conf but, would prefer to have it work correctly.
Any help would be appreciated thank you.

rollercoaster
2020-01-29, 06:15
Probably because NetworkManager is handling your resolv.conf. You can try this:root@kali:~# nmcli connection show Wired\ connection\ 1 | grep 'ipv4.dns:'ipv4.dns: root@kali:~# nmcli connection modify Wired\ connection\ 1 ipv4.dns root@kali:~# nmcli connection reload