You are not logged in.

#1 2020-12-16 20:22:37

cmonty14
Member
Registered: 2019-10-05
Posts: 56

(SOLVED) DNS resolve issue with subdomains

Hi,
I'm running dnsmasq on my server and I want to fetch data from a weather service.
The application is trying to connect to subdomain api.openweathermap.org.

Verifying the issue with nslookup confirms the DNS issue:
root@pc5-loxberry:~# nslookup api.openweathermap.org
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find api.openweathermap.org: SERVFAIL

After executing dig a api.openweathermap.org the name resolution works:
root@pc5-loxberry:~# dig a api.openweathermap.org

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Raspbian <<>> a api.openweathermap.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58267
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;api.openweathermap.org.                IN      A

;; ANSWER SECTION:
api.openweathermap.org. 2560    IN      A       82.196.7.246
api.openweathermap.org. 2560    IN      A       37.139.20.5
api.openweathermap.org. 2560    IN      A       37.139.1.159
api.openweathermap.org. 2560    IN      A       188.166.16.132

;; Query time: 31 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mi Dez 16 21:12:38 CET 2020
;; MSG SIZE  rcvd: 115

root@pc5-loxberry:~# nslookup api.openweathermap.org
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   api.openweathermap.org
Address: 37.139.20.5
Name:   api.openweathermap.org
Address: 82.196.7.246
Name:   api.openweathermap.org
Address: 188.166.16.132
Name:   api.openweathermap.org
Address: 37.139.1.159
** server can't find api.openweathermap.org: SERVFAIL

Can I configure dnsmasq for a working name resolution of subdomain api.openweathermap.org?

Last edited by cmonty14 (2020-12-17 07:01:58)

Offline

#2 2020-12-16 23:33:56

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: (SOLVED) DNS resolve issue with subdomains

Please edit your post to use code tags.

Offline

#3 2020-12-17 04:56:21

seth
Member
Registered: 2012-09-03
Posts: 60,955

Re: (SOLVED) DNS resolve issue with subdomains

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Raspbian <<>> a api.openweathermap.org

Ahemm…

Sounds more like an issue w/ your nsswitch and one element before dns triggers a return (typically for the "!UNAVAIL=return" stanza)
Dig will just perform a DNS lookup and the response likely feed the cache for the previous element.

systemd-resolved? mdns?

Online

#4 2020-12-17 07:02:49

cmonty14
Member
Registered: 2019-10-05
Posts: 56

Re: (SOLVED) DNS resolve issue with subdomains

Root cause:
Wrong netmask configured in router (in client mode) that is providing DNS

Offline

Board footer

Powered by FluxBB