'DNS resolution failed'

Hi
I am getting below Error when i try to access http://localhost:8088/namespaces “temporal-web”

temporal-web_1          | OperationalError: 14 UNAVAILABLE: DNS resolution failed
temporal-web_1          |     at Object.exports.createStatusError (/usr/app/node_modules/grpc/src/common.js:91:15)
temporal-web_1          |     at Object.onReceiveStatus (/usr/app/node_modules/grpc/src/client_interceptors.js:1209:28)
temporal-web_1          |     at InterceptingListener._callNext (/usr/app/node_modules/grpc/src/client_interceptors.js:568:42)
temporal-web_1          |     at InterceptingListener.onReceiveStatus (/usr/app/node_modules/grpc/src/client_interceptors.js:618:8)
temporal-web_1          |     at callback (/usr/app/node_modules/grpc/src/client_interceptors.js:847:24) {
temporal-web_1          |   cause: Error: 14 UNAVAILABLE: DNS resolution failed
temporal-web_1          |       at Object.exports.createStatusError (/usr/app/node_modules/grpc/src/common.js:91:15)
temporal-web_1          |       at Object.onReceiveStatus (/usr/app/node_modules/grpc/src/client_interceptors.js:1209:28)
temporal-web_1          |       at InterceptingListener._callNext (/usr/app/node_modules/grpc/src/client_interceptors.js:568:42)
temporal-web_1          |       at InterceptingListener.onReceiveStatus (/usr/app/node_modules/grpc/src/client_interceptors.js:618:8)
temporal-web_1          |       at callback (/usr/app/node_modules/grpc/src/client_interceptors.js:847:24) {
temporal-web_1          |     code: 14,
temporal-web_1          |     metadata: Metadata { _internal_repr: {}, flags: 0 },
temporal-web_1          |     details: 'DNS resolution failed'
temporal-web_1          |   },
temporal-web_1          |   isOperational: true,
temporal-web_1          |   code: 14,
temporal-web_1          |   metadata: Metadata { _internal_repr: {}, flags: 0 },
temporal-web_1          |   details: 'DNS resolution failed'
temporal-web_1          | }

My compose file

version: "3"
services:
  temporal:
    image: temporalio/auto-setup:${SERVER_TAG:-1.3.2}
    ports:
      - "7233:7233"
    volumes:
      - ${DYNAMIC_CONFIG_DIR:-../config/dynamicconfig}:/etc/temporal/config/dynamicconfig
    environment:
      - "DB=postgresql"
      - "DB_PORT=5432"
      - "POSTGRES_USER=postgres"
      - "POSTGRES_PWD=postgres"
      - "POSTGRES_SEEDS=172.18.0.1"
      - "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
  temporal-admin-tools:
    image: temporalio/admin-tools:${SERVER_TAG:-1.3.2}
    network_mode: host
    stdin_open: true
    tty: true
    environment:
      - "TEMPORAL_CLI_ADDRESS=temporal"
    depends_on:
      - temporal
  temporal-web:
    image: temporalio/web:${WEB_TAG:-1.3.0}
    network_mode: host
    environment:
      - "TEMPORAL_GRPC_ENDPOINT=temporal:7233"
      - "TEMPORAL_PERMIT_WRITE_API=true"
    ports:
      - "8088:8088"
    depends_on:
      - temporal

Please help me on this.

Are you able to reach temporal host from within web container?

Yes, I am able to reach temporal host. Found the problem its in compose file is used “network_mode:host”

Updated compose file

version: "3"
services:
  temporal:
    image: temporalio/auto-setup:${SERVER_TAG:-1.3.2}
    ports:
      - "7233:7233"
    volumes:
      - ${DYNAMIC_CONFIG_DIR:-../config/dynamicconfig}:/etc/temporal/config/dynamicconfig
    environment:
      - "DB=postgresql"
      - "DB_PORT=5432"
      - "POSTGRES_USER=postgres"
      - "POSTGRES_PWD=postgres"
      - "POSTGRES_SEEDS=172.18.0.1"
      - "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
  temporal-admin-tools:
    image: temporalio/admin-tools:${SERVER_TAG:-1.3.2}
    stdin_open: true
    tty: true
    environment:
      - "TEMPORAL_CLI_ADDRESS=temporal"
    depends_on:
      - temporal
  temporal-web:
    image: temporalio/web:${WEB_TAG:-1.3.0}
    environment:
      - "TEMPORAL_GRPC_ENDPOINT=temporal:7233"
      - "TEMPORAL_PERMIT_WRITE_API=true"
    ports:
      - "8088:8088"
    depends_on:
      - temporal

Thank You