Only a part of our genetic inheritance is fixed.Personally, the DNA bit sounds confusing.
There are large parts which can be switched on and off, and turned up and down by the environment. It is the emerging field of "epigenetics", in which before and even after birth, individuals bodies are optimised for the environment that they are going to be living in.
In the case of experiments with rats, even stressing the male, then, once he'd mated, removing him from the experiment, resulted in more stress susceptible pups, which passed that stress susceptibility on to their pups.
In humans, there has been a lot of work done on the people who were in the third trimester of gestation during the "Dutch Hunger Winter" where retreating Axis forces removed all of the food from the Dutch population (is it any wonder that so many of the Traumatologists come from the tiny country that is Holland?).
Those individuals bodies are very prone to low blood sugar, to laying down fat, they have a disproportionately high rate of heart disease,of diabetes, and of psychoses, and so do their children.
Probably a good intro for anyone who is interested, would be to find some of Robert Sapolsky's lectures on epigenetics on youtube.