Last active
August 31, 2025 14:59
-
-
Save LizenzFass78851/d60626011a9881f71db60a0b233209fd to your computer and use it in GitHub Desktop.
Scipt to create hostslist to block all subdomains of a domain over the hosts file
This file contains hidden or 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 | |
| LISTOFDOMAINS="officeapps.live.com | |
| officeclient.microsoft.com" | |
| HOSTSFILE="hosts.list" | |
| rm -f "${HOSTSFILE}" | |
| cat <<EOL > "${HOSTSFILE}" | |
| # This is autogenerated by a script | |
| # This list may contain incorrect entries and can destroy the entire local DNS Resolution | |
| EOL | |
| for LISTOFDOMAIN in ${LISTOFDOMAINS}; do | |
| echo "# This list contain most subdomains of ${LISTOFDOMAIN}" >> "${HOSTSFILE}" | |
| OUTPUTS=$(curl -s "https://crt.sh/?q=%25.${LISTOFDOMAIN}&output=json" \ | |
| | jq -r '.[].common_name' \ | |
| | grep -v '^\*\.' \ | |
| | sort -u \ | |
| | grep "${LISTOFDOMAIN}") | |
| for OUTPUT in ${OUTPUTS}; do | |
| echo "0.0.0.0 ${OUTPUT}" >> "${HOSTSFILE}" | |
| done | |
| echo "" >> "${HOSTSFILE}" | |
| done |
This file contains hidden or 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
| # This is autogenerated by a script | |
| # This list may contain incorrect entries and can destroy the entire local DNS Resolution | |
| # This list contain most subdomains of officeapps.live.com | |
| 0.0.0.0 aad-application-cert-000.oloobe.officeapps.live.com | |
| 0.0.0.0 aad.imagetodoc.edog.officeapps.live.com | |
| 0.0.0.0 aad.imagetodoc.officeapps.live.com | |
| 0.0.0.0 advancedformulaenvironment.officeapps.live.com | |
| 0.0.0.0 advancedformulaenvironment-preview.officeapps.live.com | |
| 0.0.0.0 appsforoffice.edog.officeapps.live.com | |
| 0.0.0.0 appsforoffice.officeapps.live.com | |
| 0.0.0.0 beta.officeapps.live.com | |
| 0.0.0.0 c2rsetup.edog.officeapps.live.com | |
| 0.0.0.0 c2rsetup.officeapps.live.com | |
| 0.0.0.0 callbacktokencert.imagetodoc.edog.officeapps.live.com | |
| 0.0.0.0 callbacktokencert.imagetodoc.officeapps.live.com | |
| 0.0.0.0 captions.edog.officeapps.live.com | |
| 0.0.0.0 captions.officeapps.live.com | |
| 0.0.0.0 cdn.ocws.officeapps.live.com | |
| 0.0.0.0 cdn.odc.officeapps.live.com | |
| 0.0.0.0 cdn.uci.officeapps.live.com | |
| 0.0.0.0 clientauthentication.retailer.officeapps.live.com | |
| 0.0.0.0 client.roaming.officeapps.live.com | |
| 0.0.0.0 config.edog.officeapps.live.com | |
| 0.0.0.0 config.officeapps.live.com | |
| 0.0.0.0 dd.edog.officeapps.live.com | |
| 0.0.0.0 designerapp.edog.officeapps.live.com | |
| 0.0.0.0 designerapp.officeapps.live.com | |
| 0.0.0.0 dots.officeapps.live.com | |
| 0.0.0.0 drs.officeapps.live.com | |
| 0.0.0.0 drs.sdf.officeapps.live.com | |
| 0.0.0.0 edognew.officeapps.live.com | |
| 0.0.0.0 edog.officeapps.live.com | |
| 0.0.0.0 eus2-000.excelsgs.edog.officeapps.live.com | |
| 0.0.0.0 excelca.edog.officeapps.live.com | |
| 0.0.0.0 excelca.officeapps.live.com | |
| 0.0.0.0 excelcs.edog.officeapps.live.com | |
| 0.0.0.0 excelcs.officeapps.live.com | |
| 0.0.0.0 excelps.edog.officeapps.live.com | |
| 0.0.0.0 excelps.officeapps.live.com | |
| 0.0.0.0 excelsgs.edog.officeapps.live.com | |
| 0.0.0.0 excelsgs.officeapps.live.com | |
| 0.0.0.0 ff3-collabrtcsc.officeapps.live.com | |
| 0.0.0.0 ff4-collabrtcsc.officeapps.live.com | |
| 0.0.0.0 ffc-visio.officeapps.live.com | |
| 0.0.0.0 firstpartyaadencrypt.oloobe.officeapps.live.com | |
| 0.0.0.0 firstpartyaadencryptsecondary.oloobe.officeapps.live.com | |
| 0.0.0.0 firstpartyaad.oloobe.officeapps.live.com | |
| 0.0.0.0 fs.officeapps.live.com | |
| 0.0.0.0 getitemsworker.edog.officeapps.live.com | |
| 0.0.0.0 getitemsworker.officeapps.live.com | |
| 0.0.0.0 group.ols.officeapps.live.com | |
| 0.0.0.0 hubble-aad-prod.officeapps.live.com | |
| 0.0.0.0 hubble.edog.officeapps.live.com | |
| 0.0.0.0 hubble-msas2s.officeapps.live.com | |
| 0.0.0.0 hubble.officeapps.live.com | |
| 0.0.0.0 imagetodoc.edog.officeapps.live.com | |
| 0.0.0.0 imagetodoc.officeapps.live.com | |
| 0.0.0.0 imganalysissvc.edog.officeapps.live.com | |
| 0.0.0.0 imganalysissvc.officeapps.live.com | |
| 0.0.0.0 ink.edog.officeapps.live.com | |
| 0.0.0.0 ink.officeapps.live.com | |
| 0.0.0.0 ITAR-WAC-MDM.officeapps.live.com | |
| 0.0.0.0 layoutservice.edog.officeapps.live.com | |
| 0.0.0.0 layoutservice.officeapps.live.com | |
| 0.0.0.0 mcypherPiiDecryption.officeapps.live.com | |
| 0.0.0.0 mediasnap.edog.officeapps.live.com | |
| 0.0.0.0 mediasnap.officeapps.live.com | |
| 0.0.0.0 mobius.edog.officeapps.live.com | |
| 0.0.0.0 mobius.officeapps.live.com | |
| 0.0.0.0 mpns.imagetodoc.edog.officeapps.live.com | |
| 0.0.0.0 mpns.imagetodoc.officeapps.live.com | |
| 0.0.0.0 mrodevicemgr.edog.officeapps.live.com | |
| 0.0.0.0 mrodevicemgr.officeapps.live.com | |
| 0.0.0.0 mroeportal.edog.officeapps.live.com | |
| 0.0.0.0 nexusariaconnector.officeapps.live.com | |
| 0.0.0.0 nexus.officeapps.live.com | |
| 0.0.0.0 nexuspayload.officeapps.live.com | |
| 0.0.0.0 nexusrules.officeapps.live.com | |
| 0.0.0.0 o365discovery.edog.officeapps.live.com | |
| 0.0.0.0 o365discovery.officeapps.live.com | |
| 0.0.0.0 objectstore.ocs.officeapps.live.com | |
| 0.0.0.0 objectstore.odc.officeapps.live.com | |
| 0.0.0.0 objectstore.rs.officeapps.live.com | |
| 0.0.0.0 ocsa.edog.officeapps.live.com | |
| 0.0.0.0 ocsa.officeapps.live.com | |
| 0.0.0.0 ocsredir.edog.officeapps.live.com | |
| 0.0.0.0 ocsredir.officeapps.live.com | |
| 0.0.0.0 ocws-aad-edog.officeapps.live.com | |
| 0.0.0.0 ocws-aad-prod.officeapps.live.com | |
| 0.0.0.0 ocws.cosmic.sdf.officeapps.live.com | |
| 0.0.0.0 ocws.edog.officeapps.live.com | |
| 0.0.0.0 ocws.officeapps.live.com | |
| 0.0.0.0 odc.edog.officeapps.live.com | |
| 0.0.0.0 odc.officeapps.live.com | |
| 0.0.0.0 odcsm-aad-edog.officeapps.live.com | |
| 0.0.0.0 odcsm-aad-prod.officeapps.live.com | |
| 0.0.0.0 odcsm-bec-edog.officeapps.live.com | |
| 0.0.0.0 odcsm-bec-prod.officeapps.live.com | |
| 0.0.0.0 odcsm.edog.officeapps.live.com | |
| 0.0.0.0 odcsm.officeapps.live.com | |
| 0.0.0.0 officeapps.live.com | |
| 0.0.0.0 offline.officeapps.live.com | |
| 0.0.0.0 oloobe.officeapps.live.com | |
| 0.0.0.0 oloobe-prod-geneva.officeapps.live.com | |
| 0.0.0.0 ols.edog.officeapps.live.com | |
| 0.0.0.0 ols-idsapi.officeapps.live.com | |
| 0.0.0.0 ols.officeapps.live.com | |
| 0.0.0.0 ols.oloobe.officeapps.live.com | |
| 0.0.0.0 oss.officeapps.live.com | |
| 0.0.0.0 oss.sdf.officeapps.live.com | |
| 0.0.0.0 Pathfinder-RTC-MDM.officeapps.live.com | |
| 0.0.0.0 pims-s2s-000.oloobe.officeapps.live.com | |
| 0.0.0.0 plattest.edog.officeapps.live.com | |
| 0.0.0.0 pods.edog.officeapps.live.com | |
| 0.0.0.0 pods.officeapps.live.com | |
| 0.0.0.0 powerpointwrs-prod-osi2spo.edog.officeapps.live.com | |
| 0.0.0.0 pp1-collabrtcsc.officeapps.live.com | |
| 0.0.0.0 pp2-collabrtcsc.officeapps.live.com | |
| 0.0.0.0 ppe.oloobe.officeapps.live.com | |
| 0.0.0.0 pptca.edog.officeapps.live.com | |
| 0.0.0.0 pptca.officeapps.live.com | |
| 0.0.0.0 pptcms.edog.officeapps.live.com | |
| 0.0.0.0 pptcs.edog.officeapps.live.com | |
| 0.0.0.0 pptcs.officeapps.live.com | |
| 0.0.0.0 pptcs-prod-osi2spo.edog.officeapps.live.com | |
| 0.0.0.0 pptcts.edog.officeapps.live.com | |
| 0.0.0.0 pptcts.officeapps.live.com | |
| 0.0.0.0 pptexp.edog.officeapps.live.com | |
| 0.0.0.0 pptexp.officeapps.live.com | |
| 0.0.0.0 ppthms.edog.officeapps.live.com | |
| 0.0.0.0 pptliveagent.edog.officeapps.live.com | |
| 0.0.0.0 pptliveagent.officeapps.live.com | |
| 0.0.0.0 pptlive.edog.officeapps.live.com | |
| 0.0.0.0 pptmobius.edog.officeapps.live.com | |
| 0.0.0.0 pptmobius.officeapps.live.com | |
| 0.0.0.0 pptps.edog.officeapps.live.com | |
| 0.0.0.0 pptps.officeapps.live.com | |
| 0.0.0.0 pptservicecast.edog.officeapps.live.com | |
| 0.0.0.0 pptservicecast.officeapps.live.com | |
| 0.0.0.0 pptservicescast.edog.officeapps.live.com | |
| 0.0.0.0 pptservicescast.officeapps.live.com | |
| 0.0.0.0 pptsgs.edog.officeapps.live.com | |
| 0.0.0.0 pptsgs.officeapps.live.com | |
| 0.0.0.0 pptwrs.edog.officeapps.live.com | |
| 0.0.0.0 pptwrs.officeapps.live.com | |
| 0.0.0.0 present.edog.officeapps.live.com | |
| 0.0.0.0 present.officeapps.live.com | |
| 0.0.0.0 previewbundle.wac.gov.officeapps.live.com | |
| 0.0.0.0 Prod-MDM.officeapps.live.com | |
| 0.0.0.0 Prod-OCS-MDM.officeapps.live.com | |
| 0.0.0.0 Production-RTC-MDM.officeapps.live.com | |
| 0.0.0.0 prod-wac-kvauth.officeapps.live.com | |
| 0.0.0.0 Prod-WAC-MDM.officeapps.live.com | |
| 0.0.0.0 redfox.edog.officeapps.live.com | |
| 0.0.0.0 redfox.officeapps.live.com | |
| 0.0.0.0 remoteuls-test-cosmic.officeapps.live.com | |
| 0.0.0.0 roaming-aad-prod.officeapps.live.com | |
| 0.0.0.0 roaming.edog.officeapps.live.com | |
| 0.0.0.0 roaming.officeapps.live.com | |
| 0.0.0.0 rps.cek.oloobe.officeapps.live.com | |
| 0.0.0.0 rps.dek.oloobe.officeapps.live.com | |
| 0.0.0.0 rps-edog.officeapps.live.com | |
| 0.0.0.0 rpssecdek.oloobe.officeapps.live.com | |
| 0.0.0.0 RTC-Kusto-Prod.officeapps.live.com | |
| 0.0.0.0 RTC-MDM-Prod.officeapps.live.com | |
| 0.0.0.0 rtc-sdf-cosmic.officeapps.live.com | |
| 0.0.0.0 rtc-test-cosmic.officeapps.live.com | |
| 0.0.0.0 slideshow.edog.officeapps.live.com | |
| 0.0.0.0 slideshow.officeapps.live.com | |
| 0.0.0.0 snap.edog.officeapps.live.com | |
| 0.0.0.0 snap.officeapps.live.com | |
| 0.0.0.0 stateservice.edog.officeapps.live.com | |
| 0.0.0.0 stateservice.officeapps.live.com | |
| 0.0.0.0 test2.sdf.officeapps.live.com | |
| 0.0.0.0 testKeyvault.officeapps.live.com | |
| 0.0.0.0 test.sdf.officeapps.live.com | |
| 0.0.0.0 textanalysis.edog.officeapps.live.com | |
| 0.0.0.0 textanalysis.officeapps.live.com | |
| 0.0.0.0 Trailblazer-RTC-MDM.officeapps.live.com | |
| 0.0.0.0 uci.edog.officeapps.live.com | |
| 0.0.0.0 uci.officeapps.live.com | |
| 0.0.0.0 wac2fcm.officeapps.live.com | |
| 0.0.0.0 WAC-AAD-E03-EncryptCert.officeapps.live.com | |
| 0.0.0.0 WAC-AAD-E03-GAL-EncryptCert.officeapps.live.com | |
| 0.0.0.0 WAC-AAD-E03-PATHFINDER-EncryptCert.officeapps.live.com | |
| 0.0.0.0 WAC-AAD-E03-TRAILBLAZER-EncryptCert.officeapps.live.com | |
| 0.0.0.0 wac-ado-icm-integration.officeapps.live.com | |
| 0.0.0.0 wac-ado-icm-integration-test.officeapps.live.com | |
| 0.0.0.0 wacgriffinsecretmanagement.officeapps.live.com | |
| 0.0.0.0 WacSecretmanagementTest.officeapps.live.com | |
| 0.0.0.0 wordca.edog.officeapps.live.com | |
| 0.0.0.0 wordca.officeapps.live.com | |
| 0.0.0.0 wordcs.edog.officeapps.live.com | |
| 0.0.0.0 wordcs.officeapps.live.com | |
| 0.0.0.0 wordcs-prod-osi2spo.edog.officeapps.live.com | |
| 0.0.0.0 wordps.edog.officeapps.live.com | |
| 0.0.0.0 wordps.officeapps.live.com | |
| 0.0.0.0 wordsgs.edog.officeapps.live.com | |
| 0.0.0.0 wordsgs.officeapps.live.com | |
| 0.0.0.0 wordwrs.edog.officeapps.live.com | |
| 0.0.0.0 wordwrs.officeapps.live.com | |
| 0.0.0.0 wus.ocws.cosmic.sdf.officeapps.live.com | |
| # This list contain most subdomains of officeclient.microsoft.com | |
| 0.0.0.0 officeclient.microsoft.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment