I have read all the answers I can find about setting up dnsmasq as a local DNS server for development. But I can't make it work for my case. Most out there want 127.0.0.1 to be resolved for names in the .dev domain.
In my case I have a VirtualBox virtual machine running windows in my MacBook Air. This Windows runs SQL server express. It is set up with two interfaces - a network bridge - to share the external wifi interface and be a peer on my local network when I am on line. I also have VirtualBox set up a host-only
network. The subbnet is 192.168.56.0/24 with my Mac being .1 and the Windows virtual machine being .2.
dnsmasq running on the MacBook support this and from a Windows perspective it does everything perfectly, on-line and off. Using its ability to assign complete domains an address it gives .rab to 192.168.56.1 and .tig to 192.168.56.2
On the Mac itself I am developing a nodejs application, which is a web server (so it needs a domain name - lets say abc.rab - my Mac is called Rabbit) and to acccess the Windows machine's database (called abc.tig - Windows machine is called Tigger). Here things don't seem to work.
I wrote a small nodejs program to test DNS lookup
'use strict';
const dns = require('dns');
dns.lookup('abc.tig',(err,add,family) =>{
console.log('addresses:',add);
});
and it can't find the address. Yet on the terminal this DNS lookup works
alan@rabbit:~/Documents$nslookup abc.tig
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: abc.tig
Address: 192.168.56.2
alan@rabbit:~/Documents$
In a web browser abc.rab also tells me it can't find the domain name.
As I said, I had set up dnsmasq to run on all interfaces. In the network properties for my Wi-Fi interface I have set nameservers as 127.0.0.1 and 8.8.8.8
In /etc/resolver I created a file called literally 'whatever' (the answer that I read about this didn't make it clear if it literally had to be called that or it was just an example) with
nameserver 127.0.0.1
domain .
in it
Obviously there are two name resolution processes in place. The mDNSResponder and dnsmasq are both shown running in my activity panel. I presume different ones are being used by the terminal and by my application
What am I doing wrong here? (writing and testing this I am currently online)
(PS I have a similar setup working on my home development machine running linux working perfectly - I just want to be able to develop on the move).