CoderSathi
  • Tutorial
    • Java Tutorial
    • Swing Tutorial
    • JDBC Tutorial
    • Java String Tutorial
    • Servlet and JSP Tutorial
  • Mongo DB
  • AWS
  • DevOps
  • Linux
  • Git
Home > How to > [Solved]- DNSHostNotFound: Failed to look up service “”: DNS name does not exist issue while connecting to MongoDb Atlas

[Solved]- DNSHostNotFound: Failed to look up service “”: DNS name does not exist issue while connecting to MongoDb Atlas

Learn the concepts, implementation details, and practical steps with a clean developer-focused walkthrough.

Yuba Raj Kalathoki
By Yuba Raj Kalathoki
Published: March 23, 2021 ยท 1 min read ยท 2 Comments
Share: X in ๐Ÿ”—

When we try to connect MongoDB Atlas from our local computer we may face DNSHostNotFound: Failed to look up service “”: DNS name does not exist issue. Or we may see another error like: `Error: queryTxt ETIMEOUT`.

There could be many reasons but the most common one is, ISP (Internet Service Provider) uses DHCP (Dynamic Host Configuration Protocol) and it may block the Atlas address.

To solve this issue, we can change the DNS setting in our computer and use the public DNS server like Google.

Steps to fix DNSHostNotFound: Failed to look up service “”: DNS name does not exist issue in Windows 10

  1. Go to Control Panel
  2. Click Network and Internet
  3. Click Network and Sharing Center
  4. Click on Change adapter settings (You may see it in the left top)
  5. Select the connection you want to change the configuration and click on Properties
    • You may prompt for an administrative password.
  6. Go to the Networking tab and select Internet Protocol Version 4 (TCP/IPv4)
  7. Click Properties button.
  8. In the General tab, click on Use the following DNS server address:
  9. Add Preferred DNS server: 8.8.8.8.
  10. (Optional) Alternate DNS server: 8.8.4.4
  11. Click Ok
Setting custom DNS in windows

Done!

Now, when you try to connect to your Atlas cluster and it should be connected successfully and the issue DNSHostNotFound: Failed to look up service "": DNS name does not exist will be gone.

Thanks

Related Posts:

  • Connect MongoDB Atlas Cluster Using Shell
  • How to Create a Google App Password: Full Step-by-Step Guide
  • How to Connect Java Application to a Remote Database…
  • MySQL Commands for Developers
  • How to Connect MongoDB Atlas Using Compass -…
  • How to Fix SSH Agent Forwarding on macOS: The…
Tags:atlasdevopsmongodb
Was this article helpful?
โ† Previous ArticleUnderstanding the Difference Between PATH and CLASSPATH Variables in Java
Next Article โ†’CompoundBorder in Java Swing

2 thoughts on “[Solved]- DNSHostNotFound: Failed to look up service “”: DNS name does not exist issue while connecting to MongoDb Atlas”

  1. BUSETTY SARAYU
    December 3, 2021 at 6:50 pm

    Even after doing this iam getting the same error.

    Log in to Reply
    • Coder Sathi
      December 9, 2021 at 10:34 am

      Can you verify that your IP address is enabled in Atlas Network Access? Either you have to list your IP address or set the value 0.0.0.0/0.

      Log in to Reply

Leave a Comment Cancel reply

You must be logged in to post a comment.

Recent Posts

  • How to Use AWS CloudFront Signed URLs in Spring Boot?
  • How to Fix SSH Agent Forwarding on macOS: The Ultimate Guide for Developers
  • How to Read AWS Secrets Manager in Spring Boot (Step-by-Step)
  • How to Fix “Public Key Retrieval is not allowed” MySQL JDBC Error
  • Complete Guide to JaCoCo: How to Measure Java Code Coverage Accurately
CoderSathi

Your go-to resource for Java, Spring Boot, Microservices, AWS, and modern development tutorials.

Quick Links

  • About
  • Contact

Popular Topics

  • Java
  • Spring Boot
  • AWS
  • DevOps
  • MongoDB
  • Linux
  • Git
  • How to
ยฉ 2026 CoderSathi. All rights reserved. Privacy Policy ยท Sitemap