Skip to main content
Question

manage DNS-extension

  • December 11, 2018
  • 2 replies
  • 9 views

Forum|alt.badge.img+6

We must change the DNS-settings for our clients.
I would try to manage it by jamf to expand the computername with the domain for DNS.
i found a script at jamfnation but it changes the computername to "iMac" - that's not so good for us ;-)

so i wrote this to test it for me:

"#!/bin/bash
scutil --set HostName "Computername.ourdomain"
exit 0"

it works but i don't want to make this for each mac individually.
Is there a reason to set this for all clients ?

I found many scripts on jamfnation for DNS-Changes but tey all changes the ip-adresses.....

Kind regards,
Frank

2 replies

DBrowning
Forum|alt.badge.img+25
  • Esteemed Contributor
  • December 11, 2018

You can do something like this:

#!/bin/sh

cName=$(networksetup -getcomputername)
domain="domain.name"
scutil --set HostName "$cName.$domain.name"
exit 0

Forum|alt.badge.img+6
  • Author
  • Contributor
  • December 11, 2018

That's it

It works fine !!
Thanks for your support!!!