Saturday, September 10, 2016

[Solved] Fixing external network access in Hortonworks Sandbox HDP 2.4 - DNS NAT on VirtualBox

Hi,
just in case this is of help to anyone.

I installed HDP Sandbox 2.4 for Virtualbox locally in my computer. It is under a company LAN.

All HDP services worked fine. However, I had a problem getting internet connection (e.g. in order to install packages, or compile projects with dependencies to download). It turned out there was an issue resolving names.

[root@sandbox tests]# ping google.com
ping: unknown host google.com
 
[root@sandbox tests]# ping 216.58.201.142  
PING 216.58.201.142 (216.58.201.14256(84) bytes of data.
64 bytes from 216.58.201.142: icmp_seq=1 ttl=53 time=15.4 ms
64 bytes from 216.58.201.142: icmp_seq=2 ttl=53 time=12.4 ms
...

being 216.58.201.142 the IP from google.com, resolved from my local machine.

HDP comes in its file /etc/resolv.conf with an entry pointing to the famous public Google DNS, 8.8.8.8.
It happens this is not reachable from my network, for some reason I still don't know.
What you can do, is to force HDP to use the IP of your LAN's DNS server.

You can get that by a simple nslookup from your local machine.

$ nslookup.exe google.com
Non-authoritative answer:
Server:  your.nameserver.com
Address:  x.y.z.a
 
 
Name:    google.com
Addresses:  (google IPs)

What you need is your nameserver's address, x.y.z.a. Add it to your HDP Sandbox VM /etc/resolv.conf and you should be all set.

From there you can test it by e.g. pinging

1 comment:

  1. This blog is nice and very informative. I like this blog. blogPlease keep it up.

    ReplyDelete