Tips and tricks

Simple script to check if domain has your IP in SPF-record

Posted

#!bin/bash

domains=( kindstrands.se )

for i in “${domains[@]}”
do
#in my case my server ip 80.216.114.174
check_spf=$(dig $i TXT | grep “80.216.114.174” )
if [[ -n “$check_spf” ]]
then
echo $i has SPF
else
echo $i has no SPF
fi
done

enjoy!