Results 1 to 5 of 5

Thread: DNS not working through VirtualBox NAT

  1. #1
    Join Date
    2014-Mar
    Posts
    6

    DNS not working through VirtualBox NAT

    Hey everyone,

    I have a strange problem I can't figure out. Not sure exactly what caused it either but it was likely me installing the virtualbox guest additions.

    Using VirtualBox 4.3.16
    Kali with the latest upgrade & dist-upgrade

    Using only my virtual NAT adapter on Eth0 either from a fresh boot or from a "dhclient eth0" I can ping out to the internet via an IP address (such as 8.8.8.8) but I cannot resolve any DNS hosts (I.E. "ping google.com" does not work). I have tried manually setting the DNS server in resolv.conf. On the physical side I have tried wireless connections to my corporate network and my phones hotspot along with a wired connected to a private NATed network; I get the same results regardless of what real network I am using and resolv.conf appears to be updating with correct hosts each time.

    Within Virtual Kali if I connect a USB wireless card and use Kali to directly connect to an AP I can resolve the hosts without any issues. It is as if VB's NAT function is blocking DNS. Any idea how to fix that?

  2. #2
    grab you favorite text editor, leaf,nano,gedit

    leafpad \etc\resolv.conf
    add the following

    nameserver 4.2.2.1
    nameserver 8.8.8.8
    those are verizon and google public dns, you can feel free to add whatever dns server you want here, same syntax.
    Last edited by wurmt0ngue; 2014-09-23 at 21:24. Reason: typo

  3. #3
    Join Date
    2014-Mar
    Posts
    6
    Thank you wurmt0ngue but I have tried that already. If I set the Vbox interface as a bridged adapter and manually give myself an IP address, netmask, route, and DNS servers the connection works perfectly. Same with if I use the USB wireless adapter directly in Kali; I can set those up to work correctly as well. The problem appears to be exclusively with Vbox's NAT function.

    When I monitor the connection on wireshark I can see Kali making the DNS request, but the request never passes through to the host interface and (obviously) a reply is never generated to either system.

  4. #4
    Join Date
    2014-Oct
    Posts
    2
    I have same issue I use vmware NAT, I think this began after updates recently.
    I cannot ping to internet or the router yet I can browse internet fine. However I can ping host computer.
    Nslookup, dig & host on google gives output fine.
    Disabling AV & firewall does not solve the issue.
    The issue is only when using NAT, using bridged adapter it will work.
    Is there a solution to this issue?

  5. #5
    Join Date
    2014-Oct
    Posts
    2
    Here is a solution for this issue: Replace the host machine wireless network adapter or try reinstall it's drivers again.

Similar Threads

  1. VirtualBox VM not working inside Kali VM
    By snozz in forum General Archive
    Replies: 2
    Last Post: 2023-04-09, 19:38
  2. Kali Linux on Virtualbox not working
    By joplo8899 in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2020-10-03, 03:43
  3. apt-get not working on new VirtualBox appliance import
    By NickTT in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2020-08-17, 19:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •