Seji64 / SniDust

SmartDNS Proxy to hide your GeoLocation. Based on DnsDist and nginx
GNU General Public License v3.0
156 stars 43 forks source link

Error on startup: nginx: [emerg] invalid parameter "null" in /etc/nginx/allowedClients.conf:3 #67

Closed adb76 closed 3 months ago

adb76 commented 3 months ago

Hi,

I updated today to the latest version of snidust and now get the following error on startup:

nginx: [emerg] invalid parameter "null" in /etc/nginx/allowedClients.conf:3

After analyzing the ACL creation file in my understandig the error seems to be in the jq command. When you type in the following you get 'null'

/usr/bin/dog --json heise.de  | jq '.responses[].answers[1].address
null

But when you change it to answers[], then the IP address is showing the correct value:

/usr/bin/dog --json heise.de  | jq '.responses[].answers[].address
193.99.144.80

So in generateACL.sh the correct command should be:

RESOLVE_RESULT=$(/usr/bin/dog --json "${i}" | jq -r '.responses[].answers[].address')

Kind regards.

Seji64 commented 3 months ago

i think this bug is occuring cause of pull request #64. however - you are right. if the queried host only return one A record you will get this error. but your suggested bugfix will also not work if you query an record with a CNAME (ex blog.dnsimple.com)