First, a few things to note:
On the Mac the files /etc/passwd
and /etc/master.passwd
are only consulted when the Mac is booted into single user mode.
I'm not sure what you mean by "set the master password" for the Mac. Do you mean set the password for the account 'root'?
Usually you use the passwd
command to change passwords from the command line (there is no master.passwd
command) but you can't use it from a script as it requires input.
To change a password in a script you need to use the dscl
command.
Here is an example :
dscl . -passwd /Users/tonyw newpass
Note that the above would have to be run as root, which means your script would have to be run by root. Otherwise you have to add authentication to the dscl command thus:
dscl . -u Admin -P adminpassword -passwd /Users/tonyw newpass
The user Admin
must have administrator privileges for the Mac.
(All of this is incredibly insecure as you have passwords in plain text in a script.)
Of course to set the password for 'root' just change the tonyw
to root
in the above.
Have a good look at dscl(1)
to understand the options in the above.
I experienced that problem on my MBP as well. I suppose it's a bug in Yosemite.
Here's a related question: Yosemite cannot resolve domain names maybe it gives you some insight
My work around is flushing the DNS cache:
sudo discoveryutil mdnsflushcache
if that command doesn't work try this one instead:
sudo discoveryutil udnsflushcaches
I am not sure if this helped fixing it, but I did a PRAM and SMC reset as well.
Best Answer
So, the reason for this was that my ISP is filtering DNS requests on port 53. What I did in order to circumvent this hideous action by Vodafone was to install dnsmasq on my mac and add this line to the dnsmasq.conf file:
as you can see I'm now happily using open dns' DNS on port 5353