Setting a traefik reverse proxy domain as the portainer edge agent API server URL

I'm trying to set my domain (portainer.local.example.com) as a portainer edge agent API server URL, because I have been getting the error:
2024/01/22 12:00:18 client: Specified deprecated MD5 fingerprint (xx:xx:xx:xx:xx:xx:xx), please update to the new SHA256 fingerprint: randomchar
ever since I migrated to Traefik reverse proxy, and I have read some post saying that is because I haven't changed the portainer server IP to the portainer reverse proxy domain, so correct me if I'm wrong.

But I'm currently encountering the issue in the edge agent logs:
2024/01/21 12:35PM ERR github.com/portainer/agent/edge/poll.go:152 > an error occured during short poll | error="Post \"https://portainer.local.example.com/api/endpoints/global-key\": dial tcp: lookup portainer.local.example.com on 192.168.1.200:53: read udp 172.17.0.3:45254->192.168.1.200:53: i/o timeout"

image

My current setup consist of:

  • Portainer running inside of proxmox (both server host and edge agent host)
  • Pihole running as DNS server with the local DNS records on it
  • Traefik server running as reverse proxy
    (Here is the config.yml portainer part):
http:
 #region routers 
  routers:
      
    portainer:
      entryPoints:
        - "https"
      rule: "Host(`portainer.local.example.com`)"
      middlewares:
        - default-headers
        - https-redirectscheme
      tls: {}
      service: portainer

    
#endregion
#region services
  services:

    portainer:
      loadBalancer:
        servers:
          - url: "https://192.168.1.195:9443"
        passHostHeader: true

    
#endregion
  middlewares:
    addprefix-pihole:
      addPrefix:
        prefix: "/admin"
    https-redirectscheme:
      redirectScheme:
        scheme: https
        permanent: true
    redirectregex-pihole:
      redirectRegex:
        regex: /admin/$
        replacement: /

    default-headers:
      headers:
        frameDeny: true
        browserXssFilter: true
        contentTypeNosniff: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 15552000
        customFrameOptionsValue: SAMEORIGIN
        customRequestHeaders:
          X-Forwarded-Proto: https

    idrac:
      headers:
        frameDeny: true
        browserXssFilter: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsSeconds: 15552000
        customFrameOptionsValue: SAMEORIGIN
        customRequestHeaders:
          X-Forwarded-Proto: https

    default-whitelist:
      ipWhiteList:
        sourceRange:
        - "10.0.0.0/8"
        - "192.168.0.0/16"
        - "172.16.0.0/12"

    secured:
      chain:
        middlewares:
        - default-whitelist
        - default-headers

Did you open the ports on the VMs so the container can make a request from one VM into the other?

I think so because it worked normally with the IP instead of the domain

Does the domain point to the right IP?

yes, I have been accessing portainer by the domain for quite some time, in fact when creating the edge agent portainer it self automatically set the domain in the field