# How to redirect your domain to your vm in your homelab

In this example, we'll use [Traefik](https://doc.traefik.io/traefik/) and [squareSpace](http://squarespace.com).

In your host's DNS settings, we'll redirect the domain to the desired IP address (the public IP address of your Internet box).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708508484109/dc85e8bf-5fd9-41e5-be3d-a369d578b0de.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708508526405/176aa2af-5e77-47ca-8a69-bdb2d72dd255.png align="center")

In my example, I want to redirect [www.domainname.com](http://www.domainname.com) to the public address of my Internet box.

you then need to redirect port 443 and 80 on your Internet box panel to the IP address of your reverse proxy, in this case Traefik.

then in its configuration file correspond to traefik to redirect the domain name to an ip address the configuration is as follows.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708508738206/11eef421-8994-40f9-802a-23f36dee116b.png align="center")

in server -url put the vm's ip address and in rule="Host". Set the domain name you're listening to, which will redirect to the right vm.

**it works pretty much the same for other reverse proxies. you just have to map the right url with the right ip address.**
