Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Option to set DNS? #235

Open
mcblum opened this issue Dec 9, 2017 · 4 comments
Open

Option to set DNS? #235

mcblum opened this issue Dec 9, 2017 · 4 comments
Labels

Comments

@mcblum
Copy link

mcblum commented Dec 9, 2017

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?

@alexjfisher
Copy link
Member

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'},
}

@mcblum
Copy link
Author

mcblum commented Dec 11, 2017

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

@trenta
Copy link

trenta commented Oct 10, 2018

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

@alexfouche
Copy link

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('')},
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants