Hot answers tagged

31

You can do this by using the server= directive e.g. server=/ajax.googleapis.com/8.8.8.8 would query the google public DNS server for the ajax.googleapis.com domain, similarly server=/amazonaws.com/209.244.0.3 would query Level3's public DNS server for the amazonaws.com domain. You can group multiple domains together server=/co.uk/com/8.8.4.4 Would ...


16

In BIND 9, you can define multiple "views": in effect, BIND shows one version of a DNS zone to specified clients and another version to others. This seems to be exactly what you'll need. Here is a nice introduction to using views in BIND 9: https://kb.isc.org/article/AA-00851/0/Understanding-views-in-BIND-9-by-example.html In your case, though, the ...


14

For those who like me are confusing on why port 53 is still open for all interfaces regardless which option you put in to limit it. There is one more option that need to be turned on. -z, --bind-interfaces On systems which support it, dnsmasq binds the wildcard address, even when it is listening on only some interfaces. It then discards requests ...


12

DNS server adress corresponds to DHCP option 006. According to the OpenWRT Wiki your /etc/config/dhcp should look like config 'dhcp' 'lan' ... list 'dhcp_option' '6,yourDNSIP'


11

This is also possible from the dnsmasq configuration file, and is documented in Simon Kelley's example file at http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example: # If you want dnsmasq to listen for DHCP and DNS requests only on # specified interfaces (and the loopback) give the name of the # interface (eg eth0) here. # Repeat the line for more ...


11

Setup reservations for the specific hosts using the dhcp-host option. Use tag options to flag those for a special set of options. This is completely un-tested, but I suspect your config might look something like this. Check the man page for full details. dhcp-host=00:15:99:27:f8:98,set:specialhosts,192.168.32.20 dhcp-host=00:51:99:72:8f:89,set:...


11

From the dnsmasq example config # An example of dhcp-boot with an external TFTP server: the name and IP # address of the server are given after the filename. # Can fail with old PXE ROMS. Overridden by --pxe-service. #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3 # If there are multiple external tftp servers having a same name # (using /etc/hosts) ...


10

Well in your example you're only pointing out facebook, but I guess you would have the same need for every hostname you might visit dnsmasq provides the option --all-servers --all-servers By default, when dnsmasq has more than one upstream server available, it will send queries to just one server. Setting this flag forces dnsmasq to send all ...


10

DNSmasq uses the DNS TTL value for determining the caching period. You can use the dig command to query the current TTL of your DNS server for that domain.


9

host-record=example.com,1.2.3.4 The dnsmasq man page says: --host-record=<name>[,<name>....][<IPv4-address>],[<IPv6-address>] Add A, AAAA and PTR records to the DNS. This adds one or more names to the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may appear in more than one host-record and therefore be ...


9

dig (domain information groper) and nslookup (query Internet name servers interactively) are tools that query name servers. Unless a specific name server is specified as a commandline argument they will query the name server(s) found in /etc/resolv.conf. They simply don't look at alternative sources of host information such as the /etc/hosts file or other ...


9

In dnsmasq.conf server=/docker/10.1.1.1 This would forward all requests looking for TLD .docker to 10.1.1.1. Not sure why your dnsmasq.conf is missing. What distribution are you using?


9

I had to add "bind-interfaces" to the config file, so that interface and listen-address had the desired effect. E.g.: listen-address=127.0.0.1 interface=lo bind-interfaces This will have the desired effect of listening only on localhost. I was running into issues, since I was running a public dns (that resolves just my own domains) on the public ip of the ...


8

ping use glibc's name resolution system, called Name Service Switch. This uses the /etc/nsswitch.conf file to know where to look for in order to resolve a name to an IP. The hosts: line in this file represents an order of preference for each service. For exemple, files represent the local /etc/hosts file, dns uses the /etc/resolv.conf file to contact a DNS ...


8

If you have dnsmasq enabled you need to use DHCP-option 6 So in /etc/dnsmasq.conf you would add: dhcp-option=6,8.8.8.8,8.8.4.4 To add the google DNS servers


8

You solve this by having more than one domain controller running DNS in your environment. A domain-joined client should use only domain controllers for DNS.


8

See this https://stackoverflow.com/questions/38021/how-do-i-find-the-authoritative-name-server-for-a-domain-name in short, nslookup set the query type to SOA single line: nslookup -querytype=soa google.de nslookup -d2 -type=ANY google.de nslookup -d2 -type=ANY google.de 8.8.8.8 look for: primary name server command line> nslookup > set ...


7

Sure just add multiple lines. server=/facebook.com/1.2.3.4 server=/facebook.com/2.3.4.5 Man dnsmasq -S, --server=[/[<domain>]/[domain/]] ... ... More than one -S flag is allowed, with repeated domain or ipaddr parts as required.


7

Alternative: get your devs to just append .localtest.me, which is a public DNS zone that already exists (with a * A record) for this purpose.


7

It stands to reason that the syntax in the question would make sense. However, it is even simpler than that: dhcp-option=eth0,3,10.1.0.254 dhcp-option=eth1,3,10.1.20.254 [Edit] After a couple years of this in use, I'm reporting a problem with this setup. Say you have a public and a secure network, both accessible via WiFi. If your device connects to the ...


7

There are two ways to cause dnsmasq to reload a hosts file: As Aaron Copley noted in his comment, send SIGHUP to dnsmasq. From the man page: When it receives a SIGHUP, dnsmasq clears its cache and then re-loads /etc/hosts and /etc/ethers and any file given by --dhcp-hostsfile, --dhcp-hostsdir, --dhcp-optsfile, --dhcp-optsdir, --addn-hosts or --hostsdir. ...


5

None. It's important that the nominated default gateway should be a machine on the local network which will gateway your traffic to and from the wider internet, and it's important that the nominated DNS server should be a machine which will answer your DNS queries correctly and promptly. Often these functions are consolidated into a single device, but ...


5

The primary options to use in the conf file for this would be: address=/#/10.6.66.1 interface=vlan9


5

dnsmasq can resolve its own hostname by disabling reading from /etc/hosts and configuring another config file for reading the hostnames including itself. dnsmasq configuration (/etc/dnsmaq.conf): no-hosts addn-hosts=/etc/dnsmasq_hosts In /etc/dnsmasq_hosts, configure own hostname point to ip address one needs (as well other hostnames in local lan).


5

Dnsmasq has a --min-cache-ttl=[seconds] parameter, where seconds ≤ 3600 (1 hour).


5

The issue is that you have configured dnsmasq to provide TFTP service (via the enable-tftp option in dnsmasq.conf). The service port for TFTP is UDP/69, so dnsmasq wants to bind to it, but xinetd has already done so, and it is impossible for two different processes to bind to the same service port. If you want dnsmasq to provide TFTP service, you will need ...


5

The reason you're not finding the option is that OS resolver libraries cannot use ports other than 53. While it's possible to have a nameserver forwarder use ports other than 53, it is unlikely that the authors of this software support and/or anticipate your particular use case. You would need ask them why this feature is absent. You could try something ...


5

You can do this: netstat -tupln you will get result like this: tcp 0 0 :::80 :::* LISTEN 713/httpd take the pid for the process that listening on th port 53 and kill it with this command kill -9 pid


5

That's due to CloudFlare(CDN provider of IETF) choosing ECDSAP256SHA256 as their signature algorithm. Dnsmasq has implemented ECDSA since 2.69, however it was broken and not fixed until 2.73 which was released in March 2015. Thus, you'll need a newer dnsmasq or patched version to resolve it correctly. From the dnsmasq change log in the 2.73 section: Fix ...


5

I want to know what exact server in the end had the answer. Is that possible? This is not achievable. You will not find the specific authoritative server that was consulted named anywhere in the payload of a DNS reply. There are CHAOS queries that exist for the purpose of identifying the specific recursive server that replied to you, but no such equivalent ...


Only top voted, non community-wiki answers of a minimum length are eligible