AnswerBun.com

DNS queries fail from local machine running dnsmasq

Server Fault Asked by TommyTheKid on January 3, 2022

I have a “sandbox” web server setup for my developers to work on. Each one has their own IP, with all the “production” hostnames configured, and a DNSmasq configuration to answer for those production names but to return their own IP, because its not reasonable to edit the “hosts” file on a TV or other appliance type device.

I have 8 dnsmasqd’s running on the server with configuration files that look like:

bind-interfaces
except-interface=lo
listen-address = 10.0.0.201
address=/www.mydomain.com/10.0.0.201
address=/ws.mydomain.com/10.0.0.201
address=/www.another.com/10.0.0.201
address=/ws.another.com/10.0.0.201

.. with each configuration file incremented (10.0.0.202, 10.0.0.203, etc)

While that part is working perfectly for the TV’s it is driving my a little crazy that I can’t test it from the server itself.

[[email protected] sandboxes]# host www.mydomain.com 10.0.0.201
;; connection timed out; trying next origin
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

It works just fine from other hosts on the same network…

[[email protected] ~]# host www.mydomain.com 10.0.0.201
Using domain server:
Name: 10.0.0.201
Address: 10.0.0.201#53
Aliases: 

www.mydomain.com has address 10.0.0.201

This system is the only system on the network with the 10.0.0.20x IP addresses (I verified the MAC address). It is listening and the interfaces are “UP” (etc etc).. it works on other machines, just not the local system.

Any suggestions?

Thanks in advance,

Tommy

2 Answers

I have also solved the blocker by downgrading to dnsmasq-2.48-6.el6.x86_64.rpm without this lovely non-configurable feature.

Answered by OCTAGRAM on January 3, 2022

Tumbleweeds...

So, I googled around and found NOTHING, but decided to checkout the code and compile it myself to see what would happen, and it worked fine.

Interesting... So I checked out the same version of code that CentOS 6.5 distributes (2.48) and again it works. I am fairly certain that its related to the "compile time option" of "--bind-interfaces with SO_BINDTODEVICE" .. I just did "make" with no options, and it works fine.

[[email protected] src]# ./dnsmasq -qdC /etc/sandbox-dnsmasq.d/tmcneely.dns dnsmasq: started, version 2.48 cachesize 150 dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-I18N DHCP TFTP dnsmasq: reading /etc/resolv.conf dnsmasq: using nameserver 10.0.2.3#53 dnsmasq: read /etc/hosts - 2 addresses dnsmasq: query[A] www.shoptv.com from 10.250.251.201 dnsmasq: config www.shoptv.com is 10.250.251.201 dnsmasq: query[AAAA] www.shoptv.com from 10.250.251.201 dnsmasq: config www.shoptv.com is NODATA-IPv6 dnsmasq: query[MX] www.shoptv.com from 10.250.251.201 dnsmasq: config www.shoptv.com is NODATA

[[email protected] src]# /usr/sbin/dnsmasq -qdC /etc/sandbox-dnsmasq.d/tmcneely.dns dnsmasq: started, version 2.48 cachesize 150 dnsmasq: compile time options: IPv6 GNU-getopt DBus no-I18N DHCP TFTP "--bind-interfaces with SO_BINDTODEVICE" dnsmasq: reading /etc/resolv.conf dnsmasq: using nameserver 10.0.2.3#53 dnsmasq: read /etc/hosts - 2 addresses

Answered by TommyTheKid on January 3, 2022

Add your own answers!

Related Questions

Docker compose errror when mounting the volumes

2  Asked on December 20, 2021 by zetacu

   

Domain Admin can not take ownership of files

2  Asked on December 20, 2021 by myles-rowley

   

NGINX – Only proxy a specific URL

1  Asked on December 20, 2021 by egyas

     

Assign a dedicated NIC to a KVM guest only

0  Asked on December 18, 2021 by nicapicella

   

Tasks Scheduler Windows High Availability

1  Asked on December 18, 2021 by julien-merice

       

MDB2, Pear, Mysql error

1  Asked on December 18, 2021 by kyle-hudson

   

Creating a Static IP With wlan0

4  Asked on December 18, 2021 by nmagerko

   

nginx mime types and gzip

2  Asked on December 18, 2021 by tompave

   

Golang – Nginx proxy pass issue

1  Asked on December 18, 2021 by arunkolhapur

   

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir