In this paper, we present a novel approach to estimating distribution functions, which combines ideas from Bayesian nonparametric inference, decision theory and robustness. Given a sample from a Dirichlet process on the space (?, A), with parameter in a class of measures, the sampling distribution function is estimated according to some optimality criteria (mainly minimax and regret), when a quadratic loss function is assumed. Estimates are then compared in two examples: one with simulated data and one with gas escapes data in a city network.