# Set Up a Custom Domain using CloudFlare
By default Obsidian Publish will use its own domain and the ```ID``` you choose in the beginning: ```http://publish.obsidian.md/ID```.
But you also have the possibility to use your own custom domain. You can learn more about this in the [official Documentation](https://help.obsidian.md/Obsidian+Publish/Set+up+a+custom+domain).
I used [Cloudflare](https://www.cloudfare.com) for the custom domain setup, which is what this documentation will focus on, and [Namecheap](https://www.namecheap.com), my go-to domain registrar.
Once you have purchased your desired domain, go to Cloudflare and create an account. Then go to your dashboard and click on ```Add Site```.
---
![[Screenshot 2024-07-20 at 18.08.00.webp]]
---
![[Screenshot 2024-07-20 at 18.08.10.webp]]
---
Enter your domain and choose your desired plan (the ```free plan``` will work fine).
Once you reach Step 4 ```Activation``` you will get a set of Cloudflare-branded nameservers which are going to look similar to this:
```
sasha.ns.cloudfare.com
sullivan.ns.cloudfare.com
```
---
![[Screenshot 2024-07-20 at 18.27.36.webp]]
---
These need to be added to the nameservers. If you use Namecheap you can do this by going to your domain in your domain list and clicking on ```Manage```. Then scroll down and you should see the nameservers section.
By default it will be set to ```Namecheap BasicDNS```. Switch it to ```CustomDNS``` and enter the Cloudflare-branded nameservers.
---
![[Screenshot 2024-07-20 at 18.06.53.webp]]
---
While being in the domain details also make sure that **DNSSEC is turned off** in the Advanced DNS settings.
---
![[Screenshot 2024-07-20 at 18.07.25.webp]]
---
Once everything is set up finish the set up in Cloudflare. You will now have to wait for your domain to be activated. While it says that the registrar can take up to 24 hours, it never took more than a few minutes for me. You will get an email once your domain was activated and be able to see the site's status on your dashboard .
---
![[Screenshot 2024-07-20 at 18.27.49.webp]]
---
![[Screenshot 2024-07-20 at 18.32.47.webp]]
---
To now get everything working with Obsidian, you will have to add two ```CNAME``` records in your ```DNS > Records```.
---
![[Screenshot 2024-07-20 at 18.35.17.webp]]
---
Also make sure to change your SSL/TLS encryption mode to ```Full```, as this can prevent redirect loops. You can find this setting in ```SSL/TLS > Overview```.
---
![[Screenshot 2024-07-20 at 18.38.05.webp]]
---
Now you can add your custom domain in your Obsidian Publish settings. Simply click on the publish icon and go to ```Settings > Custom Domain (Configure)``` and add your domain, e.g. ```mysite.com```. You can also set the ```publish.obisidan.md/id``` domain to redirect to your custom domain.
---
![[Screenshot 2024-07-20 at 18.40.29.webp]]
---
When now saving your site settings you should be able to see your published pages when visiting your custom domain!