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

Fix node['fqdn'] for broken reverse record lookup #1705

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

lamont-granquist
Copy link
Contributor

If broken.example.org has an A record to an IP address with no PTR
record (lets say to 10.20.30.40 which does not resolve in the configured
DNS servers):

[23] pry(main)> Addrinfo.getaddrinfo("broken.example.org", nil, nil, nil, nil, Socket::AI_CANONNAME).first.canonname
=> "broken.example.org"

vs:

> Addrinfo.getaddrinfo("broken.example.org", nil).first.getnameinfo.first
=> "10.20.30.40"

Effectively this change makes the ruby code behave like hostname -f
does which has the same behavior.

If broken.example.org has an A record to an IP address with no PTR
record (lets say to 10.20.30.40 which does not resolve in the configured
DNS servers):

```
[23] pry(main)> Addrinfo.getaddrinfo("broken.example.org", nil, nil, nil, nil, Socket::AI_CANONNAME).first.canonname
=> "broken.example.org"
```

vs:

```
> Addrinfo.getaddrinfo("broken.example.org", nil).first.getnameinfo.first
=> "10.20.30.40"
```

Effectively this change makes the ruby code behave like `hostname -f`
does which has the same behavior.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist lamont-granquist requested review from a team as code owners October 28, 2021 19:38
@lamont-granquist lamont-granquist merged commit 37de7c5 into main Oct 28, 2021
@lamont-granquist lamont-granquist deleted the lcg/fix-fqdn-for-busted-reverse-lookup branch October 28, 2021 22:29
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