Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: better docs for PreferGo in Resolver #35561

Open
renanbastos93 opened this issue Nov 13, 2019 · 8 comments
Open

net: better docs for PreferGo in Resolver #35561

renanbastos93 opened this issue Nov 13, 2019 · 8 comments
Labels
Documentation help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@renanbastos93
Copy link

Guys, how are you?

I have a suggestion to improve doc about parameter PreferGo on struct Resolver based on a comment in another issue. #19268 (comment)

Suggestion adds more a small text:

When you use the variable PreferGo set to true you will be 
able to use your dial, If you use PreferGo set to false it will ignore 
your dial and use directly "/etc/resolv.conf "

Reference Doc:

// PreferGo controls whether Go's built-in DNS resolver is preferred

@ianlancetaylor ianlancetaylor changed the title Improve doc about struct Resolver in var PreferGo net: better docs for PreferGo in Resolver Nov 13, 2019
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 13, 2019
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Nov 13, 2019
@ianlancetaylor
Copy link
Contributor

If I understand you correctly, you are suggesting that we clearly document that if PreferGo is set to false, then the Dial method in the Resolver will not be used. Is that correct?

@renanbastos93
Copy link
Author

If I understand you correctly, you are suggesting that we clearly document that if PreferGo is set to false, then the Dial method in the Resolver will not be used. Is that correct?

Hello, @ianlancetaylor

I am so sorry for my English. I'm in a constant improvement in English skills.
Well, yes correctly. When set false in PreferGo it will ignore your Dial and will be using a default.

@renanbastos93
Copy link
Author

I was thinking if you agreed to this improvement, I can open a pull request.

@ianlancetaylor
Copy link
Contributor

I agree with the improvement in general, but I don't agree with the text proposed in the original message.

@renanbastos93
Copy link
Author

I agree with the improvement in general, but I don't agree with the text proposed in the original message.

Ok, no problem.
What's your suggestion?

@ianlancetaylor
Copy link
Contributor

I'm sorry, I don't have one right now. It will take some thought and this doesn't seem urgent.

@harshathulasi
Copy link

@ianlancetaylor , I see the documentation is updated (at https://golang.org/pkg/net/#Resolver) indicting that "PreferGo" is a switch between Go's built-in DNS resolver or CGO resolver (which uses "getaddrinfo" or "getnameinfo"). Does using CGO resolver disable us using DNS dialer? Suppose I want to use CGO resolver with custom DNS server.

@ianlancetaylor
Copy link
Contributor

@ozn0417 Yes, using the cgo resolver means that it will use the DNS servers listed in /etc/resolv.conf or equivalent, and will not use whatever nameservers you want to specify. This should ideally also be part of the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants