4 min read
Domain masking or URL masking is the act of disguising the actual domain name of a web resource in favor of another domain name. This article will demonstrate how to set up domain masking on an Ethereum node with QuickNode.
- Domain name you own
- An Ethereum Node
- A Terminal Window
- Basic understanding of DNS
About Domain Masking
To better understand domain masking, let us go over an example: Say you manage a crypto project and offer a free public endpoint to your users for accessing the blockchain. The domain name for your blockchain endpoint is probably generated by your infrastructure provider and is not branded to your crypto project. You can leverage domain masking to point users to your branded domain name, one that closely represents your project, while still accessing the infrastructure providers' resources. You can also use domain masking to shorten a domain name that's otherwise lengthy and doesn't provide the best user experience.
Drawbacks of Domain Masking
Your actual domain name (a.k.a. infrastructure provider domain name) will not be private. For example, if you ping a masked domain name (a.k.a your branded domain name), you'll see the actual domain name and IP being accessed. Also, keep in mind that because your original domain name can still be accessed, it results in two locations from which your users can access the resources.
Editing your Domain's DNS Settings
The goal of this section is to modify your Domain's DNS settings to include your QuickNode endpoint. We will be masking the infrastructure provider node's domain name like crimson-quiet-violet.quiknode.pro to our own domain node.friendlynode.xyz.
First, retrieve the HTTP URL for your Ethereum node located on the Get Started tab. You will need this URL when adding a CNAME record to your domain name. If you don't have an Ethereum node already, you can create one quickly by signing up for a free QuickNode account here.
Next, head over to your domain providers management portal and navigate to the DNS settings page. You'll need to create a Canonical Name (CNAME) record so you can alias your QuickNode HTTP URL. Since there are several different domain providers, here are a few links to some that show you how to add a CNAME record to your domain:
Generally, you'll need the following items when adding a CNAME record:
- Hostname -
<subdomain>.<your-domain>.<top-level-domain>(Domain name you'll use to mask your quicknode endpoint. E.g., node.friendlynode.xyz)
- Type - CNAME (Type of DNS record)
- TTL - 3600 (Timer in seconds)
- Data -
<your-quicknode-url-without-http-schema-and-security-token>(Your Quicknode endpoint. E.g, crimson-quiet-violet.quiknode.pro)
Note that the data field should only include your Ethereum nodes name (without the HTTP schema and security token). For example, if your complete Node URL is https://crimson-quiet-violet.quiknode.pro/XX-Security-Token-XX/, you would only use crimson-quiet-violet.quiknode.pro .
It's also important to note that if you use your main domain name for your website, you cannot use it as a masked domain name. You will need to add a subdomain in front of your main domain. In our example, our main domain is friendlynode.xyz, and we're adding the subdomain node in front of it (i.e., node.friendlynode.xyz).
Verify Domain's DNS Settings
You may have to wait until your changes propagate after creating the CNAME record. In this step, we will demonstrate how to check if you set up your CNAME record correctly.
Open your terminal window and make a simple nslookup request to check that CNAME record is set up correctly. To do this, replace the
<MASK\_DOMAIN\_URL> placeholder in the nslookup request below with the domain of the CNAME record you just created and hit enter.
Pay attention to the line: node.friendlynode.xyz canonical name = crimson-quiet-violet.quiknode.pro. This line tells you your branded domain is pointed to the Ethereum node's domain. It's important that you make sure your CNAME record is configured properly before moving onto the next step.
Setup Domain Masking on Ethereum Node
Go to the Domain Masks section within the Security tab on your Ethereum node.
Type in the domain you will use to mask your current QuickNode HTTP URL, and then click Add. Once added, you will see your domain name listed in the table.
Verify Domain Masking
We can make a quick CURL request to check that our domain masking is working correctly. Replace the
<YOUR\_BRANDED\_DOMAIN> placeholder in the CURL request below with the domain of the CNAME record you just created and
<TOKEN> with the security token of your node.
There you have it, we just domain masked our Ethereum nodes URL with another domain name. Pretty cool, right? If you want to learn about other features we offer at QuickNode, check out our guides page. You can always reach out to us if you have a feature request or need help.
Subscribe to our newsletter for more articles and guides on Ethereum. If you have any feedback, feel free to reach out to us via Twitter. You can always chat with us on our Discord community server, featuring some of the coolest developers you'll ever meet :)