I did something like this and it worked. I had a 10µF tantalum capacitor close to the DS18B20. I don't remember exactly but the 10k pull up was close to the sensor.