[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

easy way to change DNS on 90 servers

I was thinking just swapping the /etc/resolv.conf.  It says not to do that in the header.  They are a mix of RHEL 6/7, Centos 5/6/7 and Oracle Linux 6/7. 

I was thinking some have DNS1=xx.xx.xx.xxx in the ifcfg-eth0 BUT not all call it eth0 - some are em1, I'm thinking even others might be something else slightly different.

So then I thought search for DNS in ifcfg-* and if you find DNS1 sset to to this, if DNS2, set it to that... 

Kind of complicated.   I have about 50 set up with Ansible.

Does anyone have a playbook setup for this already or can point me to a good resource?