Magento versions 1.9 and earlier did not include built-in support for Varnish.
Until version 1.9.x Magento provided an extension named Turpentine, which improved Magento’s compatibility with Varnish. Turpentine is a Magento extension that provides pre-configured Varnish Configuration (VCL) files that can significantly improve the cache-hit rate.
There is a Github Repo for Magento Turpentine developed by Nexcess.net.
Quoting from the Magento commerce site:
“Note that while this extension is now considered stable, it is strongly recommended that it be tested on a development/staging site before deploying on a production site due to the potential need to add custom ESI policies for blocks added by other extensions.”
Please note that at this time, Magento2 is the latest version. Upgrading to the latest version of Magento2 is recommended.
However if for whatever reason you choose to continue to use Magento 1.x, bear in mind that Magento 1.x does not offer out-of-the-box Varnish support, but there are plugins that can help your Varnish configurations with Magento 1.x.