Gmail configuration assistance - "No DNS record found for autoconfig.gmail.com"

Hi, I wanted to request guidance or assistance regarding Gmail setup in NextCloud. I’m fairly new with both Docker and NextCloud and trying to setup a server for my family. I’ve been stuck on this for a few days and unsure what to try next. Any assistance is greatly appreciated.

The Basics

Summary of the issue you are facing:

When I try to setup gmail accounts, the application generates the following error ‘There was an error while setting up your account’

Steps to replicate it (hint: details matter!):

  1. Go to mail

  2. Try to add a new account

  3. Tried both auto and manual configurations. Confirmed that IMAP and SMTP settings are correct for Gmail.

NextCloud Log Entries:

{"reqId":"vYsPbkU0vLEGQ9q45xhl","level":0,"time":"2026-02-17T08:08:57+00:00","remoteAddr":"172.65.32.248","user":"XXXXXXXXXXXXXXXXXXXXX","app":"mail","method":"GET","url":"/apps/mail/api/autoconfig/ispdb/gmail.com/XXXXXXXXXXXXXXXXXXXXX%40gmail.com","scriptName":"/index.php","message":"IsbDb: <https://autoconfig.gmail.com/mail/config-v1.1.xml?emailaddress=XXXXXXXXXXXXXXXXXXXXX@gmail.com> failed with \\"No DNS record found for autoconfig.gmail.com\\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15","version":"32.0.6.1","exception":{"Exception":"OCP\\\\Http\\\\Client\\\\LocalServerException","Message":"No DNS record found for autoconfig.gmail.com","Code":0,"Trace":\[{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"{closure:{closure:OC\\\\Http\\\\Client\\\\DnsPinMiddleware::addDnsPinning():104}:105}","class":"OC\\\\Http\\\\Client\\\\DnsPinMiddleware","type":"->","args":\["\*\*\* sensitive parameters replaced \*\*\*"\]},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"\__invoke","class":"GuzzleHttp\\\\PrepareBodyMiddleware","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"{closure:{closure:GuzzleHttp\\\\Middleware::cookies():28}:29}","class":"GuzzleHttp\\\\Middleware","type":"::","args":\["\*\*\* sensitive parameters replaced \*\*\*"\]},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":66,"function":"\__invoke","class":"GuzzleHttp\\\\RedirectMiddleware","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"{closure:{closure:GuzzleHttp\\\\Middleware::httpErrors():60}:61}","class":"GuzzleHttp\\\\Middleware","type":"::","args":\["\*\*\* sensitive parameters replaced \*\*\*"\]},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Client.php","line":333,"function":"\__invoke","class":"GuzzleHttp\\\\HandlerStack","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Client.php","line":169,"function":"transfer","class":"GuzzleHttp\\\\Client","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Client.php","line":189,"function":"requestAsync","class":"GuzzleHttp\\\\Client","type":"->","args":\["\*\*\* sensitive parameters replaced \*\*\*"\]},{"file":"/app/www/public/lib/private/Http/Client/Client.php","line":206,"function":"request","class":"GuzzleHttp\\\\Client","type":"->"},{"file":"/config/www/nextcloud/apps/mail/lib/Service/AutoConfig/IspDb.php","line":56,"function":"get","class":"OC\\\\Http\\\\Client\\\\Client","type":"->","args":\["\*\*\* sensitive parameters replaced \*\*\*"\]},{"file":"/config/www/nextcloud/apps/mail/lib/Service/AutoConfig/IspDb.php","line":148,"function":"queryUrl","class":"OCA\\\\Mail\\\\Service\\\\AutoConfig\\\\IspDb","type":"->"},{"file":"/config/www/nextcloud/apps/mail/lib/Controller/AutoConfigController.php","line":62,"function":"query","class":"OCA\\\\Mail\\\\Service\\\\AutoConfig\\\\IspDb","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"queryIspdb","class":"OCA\\\\Mail\\\\Controller\\\\AutoConfigController","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\\\AppFramework\\\\Http\\\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\\\AppFramework\\\\Http\\\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\\\AppFramework\\\\App","type":"::"},{"file":"/app/www/public/lib/base.php","line":1091,"function":"match","class":"OC\\\\Route\\\\Router","type":"->"},{"file":"/app/www/public/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}\],"File":"/app/www/public/lib/private/Http/Client/DnsPinMiddleware.php","Line":128,"message":"IsbDb: <https://autoconfig.gmail.com/mail/config-v1.1.xml?emailaddress=XXXXXXXXXXXXXXXXXXXXX@gmail.com> failed with \\"No DNS record found for autoconfig.gmail.com\\"","exception":{},"CustomMessage":"IsbDb: <https://autoconfig.gmail.com/mail/config-v1.1.xml?emailaddress=XXXXXXXXXXXXXXXXXXXXX@gmail.com> failed with \\"No DNS record found for autoconfig.gmail.com\\""}}
{"reqId":"vYsPbkU0vLEGQ9q45xhl","level":0,"time":"2026-02-17T08:08:57+00:00","remoteAddr":"172.65.32.248","user":"XXXXXXXXXXXXXXXXXXXXX","app":"mail","method":"GET","url":"/apps/mail/api/autoconfig/ispdb/gmail.com/XXXXXXXXXXXXXXXXXXXXX%40gmail.com","scriptName":"/index.php","message":"IsbDb: querying <gmail.com> via <https://gmail.com/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=XXXXXXXXXXXXXXXXXXXXX@gmail.com>","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15","version":"32.0.6.1","data":{"app":"mail"}}

Web server / Reverse Proxy Configuration

services:
  nginx-proxy:
    image: nginxproxy/nginx-proxy:1.4.0
    container_name: nginx-proxy

    dns:
      - 8.8.8.8
      - 1.1.1.1

    ports:
      - "80:80"
      - "443:443"

    volumes:
      - ./conf:/etc/nginx/conf.d
      - ./vhost:/etc/nginx/vhost.d
      - ./html:/usr/share/nginx/html
      - ./certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro

    networks:
      frontend:
        ipv4_address: 172.19.0.2

    restart: unless-stopped

  acme-companion:
    image: nginxproxy/acme-companion:2.2.10
    container_name: nginx-proxy-acme

    environment:
      DEFAULT_EMAIL: "XXXXXXXXXXXXXXXXXXXXX@gmail.com"

    volumes_from:
      - nginx-proxy

    volumes:
      - ./certs:/etc/nginx/certs:rw
      - ./acme:/etc/acme.sh
      - /var/run/docker.sock:/var/run/docker.sock:ro

    networks:
      - frontend

    restart: unless-stopped

networks:
  frontend:
    driver: bridge
    ipam:
      config:
        - subnet: 172.19.0.0/16
          gateway: 172.19.0.1

Configuration

Nextcloud

{
    "system": {
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.XXXXXXXXXX.com"
        ],
        "dbtype": "mysql",
        "version": "32.0.6.1",
        "overwrite.cli.url": "http:\/\/cloud.XXXXXXXXXXXXX.com",
        "overwritehost": "cloud.XXXXXXXXXXXXXX.com",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "opcache.memory_consumption": "512",
        "default_phone_region": "US",
        "default_locale": "en_US",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\APCu",
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpport": "465 ",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "mail_smtpsecure": "ssl",
        "loglevel": 0,
        "app_install_overwrite": []
    }
}


Docker Configuration:
services:
  nextcloud:
    image: lscr.io/linuxserver/nextcloud:32.0.6-ls416
    container_name: nextcloud

    environment:
      VIRTUAL_HOST: cloud.XXXXXXXXXXXXXXXXXXXXX.com
      LETSENCRYPT_HOST: cloud.XXXXXXXXXXXXXXXXXXXXX.com
      PUID: 1000
      PGID: 1000
      TZ: US/Arizona

    networks:
      - nginx-proxy_frontend
      - backend

    volumes:
      - ./config:/config
      - ./data:/data

    restart: unless-stopped

    dns:
      - 8.8.8.8
      - 1.1.1.1

  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb

    environment:
      PUID: 1000
      PGID: 1000
      TZ: US/Arizona
      MYSQL_ROOT_PASSWORD: ROOT_ACCESS_PASSWORD
      MYSQL_DATABASE: USER_DB_NAME
      MYSQL_USER: MYSQL_USER
      MYSQL_PASSWORD: DATABASE_PASSWORD

    networks:
      backend:
        ipv4_address: 172.16.0.10

    volumes:
      - ./db_conf:/config

    restart: unless-stopped

  collabora:
    image: collabora/code:latest
    container_name: collabora

    environment:
      VIRTUAL_HOST: collabora.XXXXXXXXXXXXXXXXXXXXX.com
      LETSENCRYPT_HOST: collabora.XXXXXXXXXXXXXXXXXXXXX.com
      VIRTUAL_PORT: 9980
      VIRTUAL_PROTO: https

    networks:
      nginx-proxy_frontend:
        ipv4_address: 172.19.0.14

    restart: unless-stopped

networks:
  nginx-proxy_frontend:
    external: true

  backend:
    driver: bridge
    ipam:
      config:
        - subnet: 172.16.0.0/16
          gateway: 172.16.0.1

Apps

The output of occ app:list (if possible).

Enabled:

  • activity: 5.0.0
  • admin_audit: 1.22.0
  • announcementcenter: 7.3.0
  • assistant: 2.12.0
  • bruteforcesettings: 5.0.0
  • calendar: 6.2.0
  • circles: 32.0.0
  • cloud_federation_api: 1.16.0
  • comments: 1.22.0
  • contacts: 8.3.2
  • contactsinteraction: 1.13.1
  • context_chat: 5.2.1
  • cookbook: 0.11.6
  • dashboard: 7.12.0
  • dav: 1.34.2
  • dicomviewer: 2.3.2
  • epubviewer: 1.8.1
  • external: 7.0.0
  • federatedfilesharing: 1.22.0
  • federation: 1.22.0
  • files: 2.4.0
  • files_downloadlimit: 5.0.0-dev.0
  • files_external: 1.24.1
  • files_fulltextsearch_tesseract: 32.0.0
  • files_pdfviewer: 5.0.0
  • files_reminders: 1.5.0
  • files_sharing: 1.24.1
  • files_trashbin: 1.22.0
  • files_versions: 1.25.0
  • firstrunwizard: 5.0.0
  • logreader: 5.0.0
  • lookup_server_connector: 1.20.0
  • mail: 5.6.12
  • money: 0.31.0
  • music: 2.5.1
  • nextcloud_announcements: 4.0.0
  • notes: 4.13.0
  • notifications: 5.0.0
  • oauth2: 1.20.0
  • password_policy: 4.0.0
  • passwords: 2025.12.21
  • photos: 5.0.0
  • privacy: 4.0.0
  • profile: 1.1.0
  • provisioning_api: 1.22.0
  • qownnotesapi: 26.2.2
  • recommendations: 5.0.0
  • related_resources: 3.0.0
  • richdocuments: 9.0.2
  • serverinfo: 4.0.0
  • settings: 1.15.1
  • sharebymail: 1.22.0
  • side_menu: 5.1.3
  • spreed: 22.0.9
  • support: 4.0.0
  • survey_client: 4.0.0
  • suspicious_login: 10.0.0
  • systemtags: 1.22.0
  • tables: 1.0.4
  • tasks: 0.17.1
  • text: 6.0.1
  • theming: 2.7.0
  • twofactor_backupcodes: 1.21.0
  • twofactor_totp: 14.0.0
  • updatenotification: 1.22.0
  • user_status: 1.12.0
  • viewer: 5.0.0
  • weather_status: 1.12.0
  • webhook_listeners: 1.3.0
  • workflowengine: 2.14.0
  • Disabled:
  • app_api: 32.0.0 (installed 32.0.0)
  • duplicatefinder: 1.7.3 (installed 1.7.3)
  • encryption: 2.20.0 (installed 2.16.0)
  • fulltextsearch: 32.0.0 (installed 32.0.0)
  • health: 2.2.2 (installed 2.2.2)
  • integration_paperless: 1.0.10 (installed 1.0.10)
  • recognize: 10.0.7 (installed 10.0.7)
  • twofactor_nextcloud_notification: 6.0.0
  • user_ldap: 1.23.0 (installed 1.23.0)
  • workflow_ocr: 1.32.1 (installed 1.32.1)
  • workflow_pdf_converter: 3.0.0 (installed 3.0.0)

Gmail configuration:

  • Followed steps to create authentication app in Google auth platform.
  • I also set the Client ID and Client Secret from Google auth platform into Administration Settings | Groupware

Additional Information:

  • I know I have duplicate DNS entries in nginx and Nextcloud docker files (above). I did this for troubleshooting. Before and after adding those entries, I could ping external site names and IPs.
  • I am unable to ping https://autoconfig.gmail.com from any PC on my network and could not ping it within the Docker container.

Google does not offer autoconfig, so the ping goes into the darkness.

Did you configure your Google-accont to accept 3rd party mail clients? - Default is “forbidden”.

Please find the guide at Google:

From Google’s help documentation.

Less secure apps & your Google Account

Starting January 2025, less secure apps, third-party apps, or devices that have you sign in with only your username and password will no longer be supported for Google Workspace accounts. For exact dates, visit Google Workspace Updates. To continue to use a specific app with your Google Account, you’ll need to use a more secure type of access that doesn’t share password data. Learn how to use Sign in with Google.

If an app or site doesn’t meet our security standards, Google might block anyone who’s trying to sign in to your account from it. Less secure apps can make it easier for hackers to get in to your account, so blocking sign-ins from these apps helps keep your account safe.

Use more secure apps

If an app uses less secure sign-in technology, you might not be able to use it with your Google Account.

Apps that use only your username or password will create errors if they try to access your Google Account. These errors can appear as:

  • “Invalid username”

  • “Invalid password”

  • “Unable to log in”

You can sign in to your Google Account from any third-party app that has the “Sign in with Google” option. In some cases you may need to remove your Google Account and then add it again on your device.

I do not think that setting exists anymore. I do not see it under my Google account settings.

I get the I.D.10.T award. Everything was correctly configured. Caught that the browser I was using had pop up blocker causing the login prompt from Google to not appear. #ImSoDumb

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.