puppet-network icon indicating copy to clipboard operation
puppet-network copied to clipboard

Option to set DNS?

Open mcblum opened this issue 7 years ago • 4 comments

Thanks for working this! I've read through the docs a couple times and I can't seem to actually find a way to set DNS servers. Am I just being dense?

mcblum avatar Dec 09 '17 19:12 mcblum

I've not tested it, but looking through the code, you might be able to use the options parameter?

network_config { 'eth0':
...
  options => {'DNS1' => '4.2.2.2'},
}

alexjfisher avatar Dec 11 '17 17:12 alexjfisher

@alexjfisher thanks! will give it a try later today.

mcblum avatar Dec 11 '17 20:12 mcblum

This won't work for a network bond because the options variable is passed to the BONDING_OPTS parameter.

trenta avatar Oct 10 '18 00:10 trenta

i resolved this issue with, for example


$intf = 'eth0'
$ns = ['127.0.0.1' '1.1.1.1']

network_config { $intf:
    options => {'dns-nameservers' => $ns.join('')},
}

alexfouche avatar Dec 09 '22 09:12 alexfouche