Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save openstacker/509e67ddb526e9b85499330a3a190338 to your computer and use it in GitHub Desktop.
Save openstacker/509e67ddb526e9b85499330a3a190338 to your computer and use it in GitHub Desktop.
build curl to support dns
If you want installable .deb package instead of putting everything to /usr/local, do this:
sudo apt-get build-dep curl
sudo apt-get install libc-ares-dev build-essential
apt-get source curl
cd curl-*
This will download curl sources with Debian/Ubuntu build files and patches.
Edit file debian/control: add line libc-ares-dev to Build-Depends
Edit file debian/rules: remove --enable-threaded-resolver and add --enable-ares to CONFIGURE_ARGS
Optional: increase version number in the first line of debian/changelog, for example 7.38.0-4+deb8u5 to 7.38.0-4+deb8u6, this way your package will not get overwritten when you install updates to your system.
Now run command
dpkg-buildpackage -us -uc -b -j4
It will generate several .deb files after an unreasonably long compilation time, go drink coffee or something while it is compiling.
You can install your new curl with c-ares support using this command:
cd ..
sudo dpkg -i curl_*.deb libcurl3_*.deb libcurl4-openssl-dev*.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment