Kali Linux resolvconf symlinks broken after every reboot

18,708

I have the same issue with my Kali install, originally I thought it was the VPN software I installed but after some research it seems to be an issue with Kali.

An easier solution for the issue that I have been using is: sudo apt-get purge resolvconf

Then directly after that run sudo apt-get install resolvconf

Unfortunately as of now I have to do this every boot but I had the same thought as you to make a startup script to automatically purge and re-install the resolvconf file. Using those two commands would be a bit easier than re creating the missing directory by hand, and possibly make writing a start up script easier.

Share:
18,708

Related videos on Youtube

Luke Sheppard
Author by

Luke Sheppard

Web Application Security Pentesting Incident Response Python, Perl, PHP, Javascript, SQL, etc. Linux, Mac, Windows

Updated on September 18, 2022

Comments

  • Luke Sheppard
    Luke Sheppard over 1 year

    I recently had to force my kali linux laptop to power off due to a desktop freeze. Now, after every reboot, DNS resolving is broken for browsers and tools like apt-get and ping, even though tools like dig still work for manual resolving. After every reboot I fix it like this:

    First I verify that most of the symlinks are there as expected:

    $ ls -altrh /etc/resolv.conf
    lrwxrwxrwx 1 root root 31 Apr 17 23:40 /etc/resolv.conf -> /etc/resolvconf/run/resolv.conf
    
    $ ls -altrh /etc/resolvconf/run
    lrwxrwxrwx 1 root root 15 Apr 17 23:40 /etc/resolvconf/run -> /run/resolvconf
    

    Then I verify that the previous configuration is still available:

    $ cat /etc/resolvconf/resolv.conf.d/base
    # Generated by NetworkManager
    nameserver 8.8.8.8
    

    Then I have to create a missing directory which one of the aforementioned symlinks is trying to point to:

    $ sudo mkdir /run/resolvconf/
    

    And finally, I have to create the missing resolv.conf file inside the directory I created, and populate the file with the nameserver info that was preserved in the file I checked earlier:

    $ sudo touch /run/resolvconf/resolv.conf
    $ sudo cp /etc/resolvconf/resolv.conf.d/base /run/resolvconf/resolv.conf
    

    Now DNS resolving works for any and all programs.

    Question: Before I go and write a startup script to automate this workaround, does anyone know how I can stop having to do this ever again? I can't figure out why this is happening. Thank you.

    System info:

    $ cat /etc/debian_version 
    Kali Linux Rolling
    $ uname -a
    Linux foobar 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) x86_64 GNU/Linux
    
  • Guy
    Guy over 6 years
  • user3502626
    user3502626 almost 6 years
    You do not have to sudo apt-get install resolvconf just sudo apt-get purge resolvconf and restart the computer. While shutting down Kali will automatically fix the problems and the next time you login you will have internet access without having to do anything.