Last active
August 29, 2015 14:08
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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