find subdomain in url

I want to find out subdomains in the url using shell script.
e.g
narendra.eukhost.com

I want to extract narendra & abc from the above urls.
Please any one can suggest idea or script ?

# echo $s
narendra.eukhost.com
# echo ${s%%.*}
narendra
# echo $s | awk -F"." '{print $1}'
narendra
# echo $s | python -c "print raw_input().split('.')[0]"
narendra

Thanks ghostdog74 for the solution.