Domainname population for NIS/yp

After a lot of searching how to populate domainname inside a docker container I came up with empty results.

From https://github.com/docker/docker/issues/13378 I found out that since version 1.11 the domainname isn’t set anymore from the hostname. There isn’t also any domainname flag that can be specified on the docker run command line.

I also found out suggestions that are mentioning to add it to /etc/hosts file, although docker do add those lines automatically I tried to add nis after it but without result:
10.123.7.101 nis.domain.net nis

I need domainname set for NIS to work, more specifically ypbind.

Is there a way to set the domainname from inside the container or when starting the container?
Is this something docker lacks, and is impossible to accomplish?

I’m using the following version on gentoo amd64:

# docker version
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.7.4
 Git commit:   78d1802
 Built:        Sun Feb 19 10:01:38 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.7.4
 Git commit:   78d1802
 Built:        Sun Feb 19 10:01:38 2017
 OS/Arch:      linux/amd64

I also tried 1.13.0 and 1.13.1 but both newer versions without result.