How to package a sensor watertight in a DIY environment?
Depending on how much you value your time and effort, and reliability, here are two proposed options:


Reliable and off-the-shelf: Purchase a DS18B20 sensor pre-fitted in a waterproof plastic or stainless steel case. The latter is currently on sale for $4.50 each:

Glass pill bottle and epoxy: 


Solder the sensor leads to wires, and then seal the exposed metal of each lead with silicone heat shrink tubing. 
Encapsulate the set of 3 wires in another larger silicone heat shrink tube. 
To be extra-careful, wrap the entire assembly very tightly in several layers of plumber's Teflon tape: This tape is very thin and flexible, so it forms an excellent humidity seal - which is why plumbers use it for fittings!
Insert this bundle into the smallest glass pill bottle which it will fit.
Fill the pill bottle with waterproof epoxy (or any epoxy- or cyanoacrylate-based waterproofing sealant) to the top, thus submerging the bundle and some of the wire into this sealant
Follow the recommended curing procedure for the sealant used: The epoxy I use can be cured using UV light, so I expose it for an hour in a nail art UV lamp. 
The last point of failure is the insulated wire itself, since typical wire used for electronics is not designed for sustained exposure to moisture. Use silicone rubber based, weatherproof insulated wire if possible. If not, use up the rest of the Teflon tape roll by wrapping it tightly around the wire bundle all the way out of the terrarium. 
All done.