Skip to content

Instantly share code, notes, and snippets.

@PeteLawrence
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeteLawrence/ee8fb9def0d908e69395 to your computer and use it in GitHub Desktop.
Save PeteLawrence/ee8fb9def0d908e69395 to your computer and use it in GitHub Desktop.
A quick and dirty script for checking that the relevant DNS records have been created for an Outlook 365 domain
#!/bin/bash
DOMAIN=$1
function checkRecords {
checkOutput "CNAME" "autodiscover.$1" "autodiscover.outlook.com"
checkOutput "TXT" "$1" "include:spf.protection.outlook.com"
checkOutput "SPF" "$1" "include:spf.protection.outlook.com"
checkOutput "SRV" "_sipfederationtls._tcp.$1" "100 1 5061 sipfed.online.lync.com."
checkOutput "SRV" "_sip._tls.$1" "100 1 443 sipdir.online.lync.com."
checkOutput "CNAME" "sip.$1" "sipdir.online.lync.com."
checkOutput "CNAME" "lyncdiscover.$1" "webdir.online.lync.com."
checkOutput "CNAME" "msoid.$1" "clientconfig.microsoftonline-p.net."
}
function checkOutput {
RESPONSE=$(dig +noall +answer -t $1 $2)
[[ $RESPONSE =~ "$3" ]] && echo "$1:$2 is OK" || echo "$1:$2 is wrong ($RESPONSE)"
}
checkRecords $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment