I use my Raspberry Pi as a headless server, and thus SSH in all the time. While I can shut down the Pi and remove the SD card to load files on, or use a USB stick, those require accessing the Pi (and in the case of the USB stick – running wires to a USB hub.) This can be a pain, so if I need to download a file I just use wget.

It comes installed with Raspbian by default as far as I know. It makes sense that it would, as so many core software rely on it. Thusly, I use it download files from the internet or, if I need to put a file on it from my Ubuntu laptop, I just pop the file into my local server and download it onto my Pi. Works great!

However, there is one issue that I have run across, and that is that just running a simple wget command like

wget soandso.com/thisZIP.tar.gz

results in an error:

Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... failed: Name or service not known.
wget: unable to resolve host address `dl.dropboxusercontent.com'

Kind of issue, you might say. It took me ages to figure this one out, but finally I discovered that if you add the -4 flag to the command, it forces wget to use IPv4 addresses, thus resolving the issue and allowing downloads to happen!


Bonus Tip!
If you are downloading a large file and the download gets interrupted, tack on the -c flag on the wget command and it will continue from where you left off. Pretty nifty, eh?

Raspberry Pi Tech Tip #1 – Fix Unable to Resolve Host Address error for wget on Raspbian

Advertisements
Tagged , , , , , ,

Tell us what you thought!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: