DEV Community

2 2

DNS lookup for local IP

Sometimes when testing you want to have easy access to your machine. For example, when building and testing a Progressive Web App running on your development machine, you probably want to test it from your phone as well. In a lot of situations, it is sufficient to just type in the IP address of your dev machine (assuming it's on your local network) and browse it. But in the case of a PWA, you need to have the website running on HTTPS.

How?

I registered a short domain name, c0dr.nl, and got a wildcard SSL certificate for that. I used DigiCert, but LetsEncrypt will work just as fine. Now instead of setting up a host with storage and such, just configure the DNS settings. I added an A record with an easy name, for example: 'twitch'. For the IP address, you'll have to add your local address. Not the one you got from your ISP, but the one you got from your local DHCP or that you entered in the IP settings. In my case, it's 192.168.1.13. That happens to be the same address I used for testing my PWA in the first place.

ISP DNS A-Record

What's left is to make sure that whatever you use to run your web app is using the certificate.

One last note. You don't have to use a wildcard certificate. But it will give you a little bit more flexibility when your IP address changes. You might work in different locations. At home and at the office. You can set up two different subdomains for that. If you only need one, use an '@' instead of a name in the A-record.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay