I have a FreeBSD machine with two NICs set up as follows:
em0 ---> IP set via DHCP (192.168.1.0/24). "home" domain
em1 ---> IP set statically (10.0.0.2). "lab" domain
For all intents and purposes, my home domain works fine. I can get to the internet and ping any host on the network. Routing also works, I can ping any host from either domain from the FreeBSD machine via IP but, I can only resolve names on the home network.
I created a
/etc/resolvconf.conf file to prepend the search domain and name server to the
resolv.conf file as follows:
I then update resolv.conf with the command:
$ sudo resolvconf -u
I can now resolve names on the
lab network, but no longer on the
home network. Manually editing the resolv.conf file and reversing the order of domains and name servers results in resolving
home but not
lab - exactly opposite.
How can I tell
resolv.conf to use one DNS server for a particular domain (the statically set IP) and allow it to get the DNS info for the other IP via DHCP?
Just for reference....
hostname="beastie1" ifconfig_em0="DHCP" ifconfig_em1="inet 10.0.0.2 netmask 255.255.255.0" defaultrouter="192.168.1.1"
# Generated by resolvconf search lab home. nameserver 10.0.0.10 nameserver 192.168.1.1
The DNS "server" on the
lab domain 10.0.0.0 is nothing more than a cheap consumer Netgear router that does provide DHCP leases. I only have this set statically because it's a TFTP server for bootimages and I purposely set it to 10.0.0.2 for ease of use when trying to flash firmware updates on some Cisco gear.