Машина Linux подключена к корпоративной сети за брандмауэром. Ниже приведены сведения:
/ etc / hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
/ etc / resolv.conf
# Generated by NetworkManager
search subdomain.domain.com
nameserver 13.108.0.11
nameserver 13.108.11.16
Создана определяемая пользователем мостовая сеть:
$ docker network create mynetwork
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
05400c341d1d bridge bridge local
fb4e364ad31b host host local
835f9d99e610 none null local
7d8fc26d3632 mynetwork bridge local
Созданы два контейнера в моей сети:
$ docker container run --name search1 --network mynetwork --network-alias search --detach elasticsearch:2
и
$ docker container run --name search2 --network mynetwork --network-alias search --detach elasticsearch:2
Круговая проверка DNS:
$ docker container run --rm -it --network mynetowrk alpine nslookup search
Вывод :
Server: 127.0.0.11
Address: 127.0.0.11:53
** server can't find search.subdomain.domain.com: NXDOMAIN
** server can't find search.subdomain.domain.com: NXDOMAIN
Контейнер /etc/resolv.conf
$ docker container run --rm -it --network mynetwork alpine cat /etc/resolv.conf
Вывод :
search subdomain.domain.com
nameserver 127.0.0.11
options ndots:0
Docker Сведения о сети, определяемые пользователем:
$ docker network inspect -v mynetwork
[
{
"Name": "mynetwork",
"Id": "7d8fc26d36323cf9ba47dbb272bf4ad15113d6b26a26fbf6c82cc1d866b480c0",
"Created": "2020-06-18T09:54:12.37673638+05:30",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.19.0.0/16",
"Gateway": "172.19.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"ec1cacb437926b5c6bb5693ab9c0afa6f8bc2764d5e15a5e15d9d5709346c1e5": {
"Name": "search1",
"EndpointID": "2c7420176adbce496e4c033416d98c290cf74dcc1e68568d7160b45cefd8d1db",
"MacAddress": "02:42:ac:13:00:02",
"IPv4Address": "172.19.0.2/16",
"IPv6Address": ""
},
"f7cf532aa71df9cefaf5575ff27d4a2f4525f7674a479989d5b96f281282b6db": {
"Name": "search2",
"EndpointID": "d641f94dfc1d898d7d8ec667b4389d4ff6a0d53be3454a89f77b24b0bd04a663",
"MacAddress": "02:42:ac:13:00:03",
"IPv4Address": "172.19.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]