how to use resolvconf command to add DNS record for multi network interface in freebsd14.2 ?

Dear all:
i have three network interfaces in my freebsd14.2. i want to use resolvconf tool to add dns for each network interface s with different dns ..how to do that ?

my searching is : resolvconf -a netinterface1 -x ??????
how to add dns nameserver 8.8.8.8 to netinterface1 ?
add dns nameserver 10.0.0.254 to netinterface2
add dns nameserver 192.168.100.254 to netinterface3

thanks,
 
A way to do it, if you have a static configuration for each interface is have a different resolve.conf for each.

resolv.conf.interface1 containing:
search blah.net
nameserver 8.8.8.8

resolv.conf.interface2 containing:
search home.net
nameserver 10.0.0.254

resolv.conf.interface3 containing:
search test.net
nameserver 192.168.100.254

then:
resolvconf -a interface1 < resolv.conf.interface1
resolvconf -a interface2 < resolv.conf.interface2
resolvconf -a interface3 < resolv.conf.interface3

But you may need to double check on HOW resolvconf chooses; not sure if it's based on the search directives or if it's based on the source interface.

I do something like this for when I bring up VPN to work so I want work names to be resolved by work DNS servers, everything else by my standard non-work DNS servers.
For openvpn command I put things in a vpn-up.sh and vpn-down.sh and add "--route-up" and "--route-pre-down" options to the openvpn command.
vpn-up.sh is simply
resolvconf -a tun0 < resolv.conf.tun0 (this contains my work DNS configuration, can also be parsed from DHCP options)

vpn-down.sh is
resolvconf -d tun0
 
Back
Top