How to setup deault network on build time?

After some dockers update or Ubuntu upgrade, the access to internet stopped working. When I execute command:

docker build .

it fails because of missing internet access, it’s working fine when I add host as network with command:

docker build . --network=host

I’m using docker inside scripts, what I cannot modify by adding extra parameter. How can I set “host” as default network for docker, or fix network access on default one?