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

Query fails if no AAAA record is available in netbox #33

Open
firefrei opened this issue Sep 5, 2022 · 2 comments
Open

Query fails if no AAAA record is available in netbox #33

firefrei opened this issue Sep 5, 2022 · 2 comments

Comments

@firefrei
Copy link

firefrei commented Sep 5, 2022

Hi,

I am using the latest version from master branch.
When a device has an IPv4 and IPv6 DNS name assigned in netbox, everything works fine. The name can be resolved, the answer contains both records.

However, if a device only has an IPv4 assigned, we are running into the following issue:

bash-5.1# ping device.blabla.local
ping: device.blabla.local: Name does not resolve
bash-5.1# nslookup   device.blabla.local
Server:		10.96.0.10
Address:	10.96.0.10#53

Name:	device.blabla.local
Address: 172.29.14.1
** server can't find device.blabla.local: NXDOMAIN

When I check the logs, I can see the following info:

[INFO] 172.29.90.1:1770 - 29865 "A IN device.blabla.local. udp 47 false 512" NOERROR qr,aa,rd 92 0.048924982s
[INFO] 172.29.90.1:55350 - 33929 "AAAA IN device.blabla.local. udp 47 false 512" NXDOMAIN qr,aa,rd 47 0.044846348s
[INFO] 172.29.90.1:4305 - 63751 "A IN device.blabla.local. udp 47 false 512" NOERROR qr,aa,rd 92 0.000204359s

I guess the problem is that NXDOMAIN is returned for AAAA, even if a record for A was found.

@oz123
Copy link
Owner

oz123 commented Sep 6, 2022

Thanks for the report. In order to help, I need to get some more information:
Which Plugin version are you using?
Which ping is it? (What os? Is it BusyBox?)
Does dig A device.blabla.local work as expected?

@firefrei
Copy link
Author

firefrei commented Sep 6, 2022

I guess we are using v0.3.0, however, at startup it prints [INFO] plugin/netbox: Version 0.1.1-dev (probably because of #32).
In our build process, we do:

&& sed -i '/^forward:forward/i netbox:github.com/oz123/coredns-netbox-plugin' plugin.cfg \
&& go get github.com/oz123/coredns-netbox-plugin@master \

Our currently running build was created 5 days ago.

With nslookup the query fails on Ubuntu 20.04 (native host, "ping from iputils s20190709") and alpine 3.16 (container, "ping from iputils v20220328-1499-gc662f01584").
Alpine does not even ping (error: "Name does not resolve"), Ubuntu does ping after some delay.

The host command on both systems returns:

user@ubuntu:~$ host device.blabla.local
device.blabla.local has address 172.29.78.1
Host device.blabla.local not found: 3(NXDOMAIN)
Host device.blabla.local not found: 3(NXDOMAIN)

dig seems to be happy on both OSs. But, it returns IPv4 or IPv6 (with AAAA parameter) separately and not combined. For this case, the result is fine.

#dig @172.29.112.112 device.blabla.local

; <<>> DiG 9.16.1-Ubuntu <<>> @172.29.112.112 device.blabla.local
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21118
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 9eeb4d23b55940fe (echoed)
;; QUESTION SECTION:
;device.blabla.local.	IN	A

;; ANSWER SECTION:
device.blabla.local. 21 IN	A	172.29.78.1

;; Query time: 0 msec
;; SERVER: 172.29.112.112#53(172.29.112.112)
;; WHEN: Tue Sep 06 07:51:50 CEST 2022
;; MSG SIZE  rcvd: 115

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

No branches or pull requests

2 participants