They definitely don't get created by our own DNA. E. coli are ubiquitous in the environment and short of bringing up an infant in a clinically sterile bubble, it is impossible to prevent inoculation of the gut with E. coli. There are many strains of E. coli and some are more harmful than others. so an infant should not be exposed to cattle excrement (or direct exposure to any excrement for that matter). The most usual source will be from contamination from parents and siblings.
Incidentally, the newborn young of some species deliberately eat their mother's faeces in order to inoculate their gut. Gut bacteria are important for the digestion of food and the manufacture of some vitamins.