How to configure DNS for Windows containers using Docker for Windows?

I’m running Windows containers on Docker for Windows. My docker-compose.yml looks like this:

version: '2.4'
services:
  web:
    image: microsoft/aspnet
    platform: windows
    networks:
      webnet:
        ipv4_address: 172.0.0.2
    ports:
      - "4119:80"
    expose:
      - "80"
    dns:
      - 8.8.8.8
      - 8.8.4.4

networks:
  webnet:
    name: "custom_network"
    ipam:
      config:
        - subnet: 172.0.0.0/16
          gateway: 172.0.0.1

When I attach PowerShell and run ping 8.8.8.8 the ping goes fine. But when I run ping a domain name I have the following result:

PS C:> ping google.com
Ping request could not find host google.com. Please check the name and try again.

And it’s the same for any other IPs/domains.
So my container has an access to Internet, but it cannot resolve domain names.
As a workaround, I’ve tried to inject pre filled hosts file into container and then ping by domains from that file works fine. It resolves IP address correctly and receives replies from remote machine.

What did I miss? How should I configure Docker containers to solve this issue?

Update:
I have the following Docker version on my PC:

> docker version
Client: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfc
 Built:             Thu Aug 29 05:26:49 2019
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.12.8
  Git commit:       6a30dfc
  Built:            Thu Aug 29 05:39:49 2019
  OS/Arch:          windows/amd64
  Experimental:     true
> docker-compose version
docker-compose version 1.24.1, build 4667896b
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.0.2q  20 Nov 2018

Source: StackOverflow