Hot answers tagged

19 votes

Restricting dnsmasq's DHCP server to one interface

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-...
  • 191
16 votes
Accepted

How to I make a domain resolve to different IP's when resolved from internal network and external network?

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 ...
  • 4,343
15 votes

Bind dnsmasq DNS to just localhost (127.0.0.1)

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 ...
14 votes
Accepted

How to serve custom dns to dhcp clients in openWrt?

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'
  • 2,949
13 votes

Resolve a domain name to CNAME alias locally using dnsmasq

You can add the following to your configuration file in dnsmasq: cname=somedomain.com,some-balancer-1213231237.ap-southeast-2.elb.amazonaws.com as specified in the man page: --cname=<cname>,[&...
  • 5,607
12 votes

dnsmasq doesn't automatically reload when entry is added to /etc/hosts

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 ...
11 votes
Accepted

Separate Servers for TFTP and DHCP for PXE Boot

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 ...
  • 306
10 votes

dnsmasq: how to increase TTL?

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

How long does dnsmasq cache dns?

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.
10 votes
Accepted

Forward dns request to another dns server

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?
  • 2,949
10 votes

Is it possible to override a single domain name using dnsmasq?

Add this line to /etc/dnsmasq.conf: addn-hosts=/etc/dnsmasq.hosts Then insert your domain names into /etc/dnsmasq.hosts: 10.0.0.1 prod.example.com. 10.0.0.2 dev.example.com. Don't forget the ...
10 votes

Find out which DNS server answered your query

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 ...
9 votes
Accepted

How does DNSMasq integrate with my router?

DNSmasq does not need to communicate with your router. The DNSmasq service just took over the service of DNS and DHCP and your router does not have to provide that anymore. Since you have disabled the ...
  • 4,205
8 votes

How to serve custom dns to dhcp clients in openWrt?

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
  • 5,587
8 votes

Configure DC & Firewall/ Router such that clients can use Internet even if DC is down?

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.
  • 101k
7 votes

Dnsmasq resolves local hostname to 127.0.0.1 all over the net

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): ...
  • 71
7 votes

dnsmasq reading /etc/hosts, but not using it

I know this is from 2011, but since it still has no accepted answer: Today, I had a similar problem. Curl worked to get the expected response from a haproxy lxc with the respective header, but ...
7 votes
Accepted

NetworkManager & dnsmasq - ignore auto DNS settings

I'm not using dnsmasq, but I had a similar issue. The solution for me was: Put the DNS servers you want in /etc/resolv.conf (ref) # IPv4 nameservers: nameserver 1.1.1.1 nameserver 1.0.0.1 # IPv6 ...
  • 198
6 votes

dnsmasq: how to increase TTL?

You can actually bypass the 3600 second --min-cache-ttl check by exploiting an integer overflow bug in the dnsmasq C source code, without any need for recompiling. Here is a value which works: Via ...
6 votes
Accepted

Find out which DNS server answered your query

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 ...
  • 32.2k
5 votes
Accepted

dnsmasq: failed to create listening socket for port 53: Address already in use

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 ...
5 votes
Accepted

possible to make samba4's internal dns server listen on non-standard port?

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 ...
  • 115k
5 votes

How to resolve all .dev domains to localhost on Windows

I have resolved this situation using Acrylic DNS Proxy. It's a free, open-source software for Windows that allows you to wildcard a folder as local top domain registry. Download Acrylic DNS Proxy ...
  • 151
5 votes

How long does dnsmasq cache dns?

The option you will need to set for dnsmasq is --min-cache-ttl, the value is in seconds. According to the dig output, the TTL is 0, if you set this to, say --min-cache-ttl=600, then the TTL value ...
  • 151
5 votes
Accepted

Using dnsmasq to service multiple subnets

I talked to a friend of mine who has dealt with this type of thing before and here is what we did to get the environment to the end-state. First, I never had to use dnsmasq -y, this worked as soon as ...
5 votes
Accepted

dnsmasq returns (false) "bogus" result for DNSSEC validation

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 ...
5 votes
Accepted

Is it possible to add a wildcard CNAME into dnsmasq?

I've checked v2.77 and found that wildcard CNAME is working there. You should add to config cname=*.example.com,default.example.com, but your dnsmasq should be authoritative server for domain(in this ...
4 votes

Setting up dnsmasq for a local network

You can also set short hostnames in /etc/hosts 192.168.3.99 website1 192.168.3.99 website2 192.168.3.99 website3 192.168.3.100 website4 and tell dnsmasq to expand all names in /etc/hosts to the ....
  • 629
4 votes
Accepted

dnsmasq failed to restart

4 11:04:42 dnsmasq[18806]: dnsmasq: bad dhcp-range at line 4 o...f That looks useful to me - did you read it? It kind of seems like there is a problem with your config. Hint: Some lines were ...
  • 115k
4 votes

Configure DC & Firewall/ Router such that clients can use Internet even if DC is down?

From your router (or whatever is handling DNS resolution), you can delegate queries for ad-related names, say all Those for the ad.example.com domain, to your domain controllers. This would allow ...
  • 109k

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