DNS configuration

Now that you have learned how to create a configuration, it's time to test this configuration on your website and make sure everything is working as expected.

For integrating WebSonic.io, you will need to point your website domain to cdn.wsonic.net.

Always test on local machine first When you are integrating WebSonic.io for the first time, you should always test the configuration on local machine without making any DNS changes to your live website.

Making host file entry for testing WebSonic.io on local machine

For testing on local machine, you need to create an entry in host file. For example, your website is running on www.example.com, then we will need to point it to cdn.wsonic.net locally. In host file, you will need to make an entry as shown below. Please note that the IP below is just an example, continue reading to learn how to get the right IP depending upon your location.

13.224.21.25 www.example.com

Steps to get the IP address for cdn.wsonic.net:

  1. If on mac or linux, open Terminal. For windows, learn here about how to execute the dig command.

  2. Run command dig cdn.wsonic.net to get the IP address as show below. Choose any of the IP, for example - 13.224.21.25. Now use this IP to create an entry in host file as shown before.

MacBook-Pro-6:~ ***********$ dig cdn.wsonic.net
; <<>> DiG 9.10.6 <<>> cdn.wsonic.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20007
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;cdn.wsonic.net. IN A
;; ANSWER SECTION:
cdn.wsonic.net. 10278 IN CNAME d2c83k61tcw1r9.cloudfront.net.
d2c83k61tcw1r9.cloudfront.net. 60 IN A 13.224.21.29
d2c83k61tcw1r9.cloudfront.net. 60 IN A 13.224.21.88
d2c83k61tcw1r9.cloudfront.net. 60 IN A 13.224.21.95
d2c83k61tcw1r9.cloudfront.net. 60 IN A 13.224.21.25
;; Query time: 215 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Mon Jun 24 10:51:52 IST 2019
;; MSG SIZE rcvd: 154

Going live with WebSonic.io

Once you have tested your website or app locally, it's time to go live. Create a CNAME record to point your website to cdn.wsonic.net.

Running website on root domain

It's pretty common to run websites on root domains such as example.com instead of www.example.com. If you need to run WebSonic.io on root domain, you can leverage ALIAS or ANAME.

Reach out to us at developer@websonic.io if you need help.

Congratulations 🙌 You have gone live with WebSonic.io. Check the network panel request and look for server header value in response. It should be WebSonic as shown in the screenshot below.