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

Add server option to unbound plugin #3713

Merged
merged 3 commits into from
Feb 21, 2018

Conversation

mcfedr
Copy link
Contributor

@mcfedr mcfedr commented Jan 23, 2018

This allows unbound plugin to connect to other servers

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

cmdArgs := []string{"stats_noreset"}

if Server != "" {
// Unbound control requires an IP address, and we want to be nice to the user
serverIp, err := net.LookupIP(Server)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will need to net.SplitHostPort and pass in only the host here.


## IP of server to connect to, read from unbound conf default, optionally '@port'
## Will lookup IP if given a hostname
server = "127.0.0.1@8953"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use : as separator

cmdArgs := []string{"stats_noreset"}

if Server != "" {
// Unbound control requires an IP address, and we want to be nice to the user
serverIp, err := net.LookupIP(Server)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a resolver that can accept a timeout.

- Use Resolver with Timeout
- Split port from host before resolving
@mcfedr
Copy link
Contributor Author

mcfedr commented Feb 19, 2018

@danielnelson How does it look now? I've been using it in production for last couple of weeks now

@danielnelson danielnelson added this to the 1.6.0 milestone Feb 21, 2018
@danielnelson danielnelson merged commit 80d9417 into influxdata:master Feb 21, 2018
@mcfedr mcfedr deleted the unbound-server branch February 21, 2018 10:03
maxunt pushed a commit that referenced this pull request Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants