Issue with go and mongodb

542 views
Skip to first unread message

Ali Hassan

unread,
Apr 8, 2020, 10:56:42 AM4/8/20
to golang-nuts
I want build connection with mongodb and go1.14 linux/amd
                 But it throw this 
                             error parsing uri : lookup abc-hwykp.mongonet on 127.0.0.53:53: cannot unmarshal DNS message 

Mongoclient code :

Capture.JPG

Capture.JPG

Please help me 

Brian Candler

unread,
Apr 8, 2020, 11:35:46 AM4/8/20
to golang-nuts
Looks like a problem with DNS.

If I do "dig enigma-hwykp.mongodb.net" I see an empty response (NOERROR, no A records).
If I do "dig abc-hwykp.mongodb.net" I see an empty response (NXDOMAIN, non-existent domain).

Either way, you won't be able to use those names for making connections.  So you'll need to work out what's going wrong here, before you start writing go programs.

Ali Hassan

unread,
Apr 8, 2020, 10:41:30 PM4/8/20
to golang-nuts
how to resolve dns problem

Kurtis Rader

unread,
Apr 8, 2020, 10:57:22 PM4/8/20
to Ali Hassan, golang-nuts
On Wed, Apr 8, 2020 at 7:41 PM Ali Hassan <alideve...@gmail.com> wrote:
how to resolve dns problem

I googled "cannot unmarshal DNS message" and the top result was https://github.com/golang/go/issues/37362 which seems relevant. It leads to https://github.com/golang/net/commit/24dd3780ca4f75fed9f321890729414a4b5d3f13#r35210450 which is a change intended to make the Go DNS code more compliant with the relevant standards. That change, however, makes it less tolerant of DNS servers that violate those standards.

P.S., Please don't include pictures of your code and error messages. Copy/paste the actual text.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/079430fd-01cb-4273-9dab-0532ae9b210c%40googlegroups.com.


--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
Reply all
Reply to author
Forward
0 new messages