How can I seal a temperature sensor against water?
There are some DIY options along the lines of potting and conformal coating:


Conformal coating.  Attach your sensor assembly to the end of the wire.  Dip the assembly into epoxy.  Let it cure.  Dip and cure several times to avoid leaks through the defects in the epoxy.  Consider using the type of epoxy, which is used for boats; not all epoxies are water-resistant.
Same as 1. but with silicone instead of epoxy.  RTV silicone can be used for this.
Same as 1. but with urethane.
Same as 1. but with thermally conductive epoxy.
Potting.  Attach your sensor assembly to the end of the wire.  Put the sensor assembly inside of the metal tube (copper or aluminium).  Fill the inside of the tube with heat sinking grease for better thermal conductivity.  Seal the tube with epoxy.
edit: Heat shrink.  I'll second the other respondents, who have mentioned heat shrink.  It can be simple heat shrink filled with glue.  The are also specialized heat shrink tubes lined with adhesive and/or wax.


DS18B20 comes in IC packages (TO-92, and others), which are made of epoxy.  By itself that introduces thermal resistance.  If having a small thermal mass and resistance is paramount, consider using a different sensor such as a thermocouple, thermistor, RTD, diode sensor in a metal case.