# Add and verify a domain

You can link your domains and subdomains to public or VPC-accessible service ports.

Each subdomain uses one [public or VPC ingress target](https://northflank.com/docs/v1/application/domains/link-a-domain-to-a-port#choose-public-or-vpc-routing). Any port that you assign must support that target.

If you use OVH, Cloudflare, NS1, or Namecheap, check our [specific guides for these domain registrars](https://northflank.com/docs/v1/application/domains/domains-on-northflank#dns-providers).

## Add a domain

You can add any domain (for example `one.yourdomain.com`) provided you have the ability to edit the DNS records.

1. [Click here](https://app.northflank.com/s/account/domains/new), or open the domains page in your account settings.

2. Click add domain, enter your domain name, and click add domain

3. You will now see the information required to verify your domain, including the `record name` and `record content`. You will need to add this to your DNS records as a text (TXT) record.

4. Open a new browser tab or window and navigate to your DNS provider

5. Log in to your control panel and find the DNS settings for your domain

6. Add a new text (TXT) record with the `record name` and `record content` specified in the entry you just generated for the domain on Northflank

7. Return to the Northflank domains page and select verify on the entry for your domain

8. Northflank will attempt to verify your domain - if not, check you have entered the record correctly and try again. If you need to, you can close the verification dialogue and come back to it later.

![A verified domain in the Northflank application](https://assets.northflank.com/documentation/v1/application/domains/add-a-domain-to-your-account/domain-verified.png)

## Add a subdomain

You can add any subdomain provided you have the ability to edit the DNS records.

1. [Click here](https://app.northflank.com/s/account/domains/subdomains/new), or open the domains page in your account settings

2. Click add subdomain and select the root domain name you want to create a subdomain for

3. Enter the subdomain you want to use and click create subdomain

4. You will now see the information required to verify your domain, including the `record name` and `record content`. You will need to add this to your DNS records as a CNAME, ALIAS, or APEX record (depending on host).
  
  
  ![An unverified subdomain in the Northflank application](https://assets.northflank.com/documentation/v1/application/domains/add-a-domain-to-your-account/subdomain-unverified.png)

5. Open a new browser tab or window and navigate to your DNS provider

6. Log in to your control panel and find the DNS settings for your domain

7. Add a new CNAME record with the `record name` and `record content` specified in the entry you just generated for the subdomain on Northflank

8. Set the time to live (TTL) as recommended, or as low as you can to make your domain available as soon as possible

9. Return to the Northflank domains page and select verify on the entry for your subdomain

10. Northflank will attempt to verify your domain - if it doesn't verify, check you have entered the record correctly and try again. If you need to, you can close the verification dialogue and come back to it later.

## Link a domain to a port

The service port must be public or VPC-accessible. To link a subdomain:

1. Open Run → Networking in the service menu.

2. Expand Custom domains & security rules for the port.

3. Click Choose a domain.

4. Select the subdomain or path to link to the port.

5. Save the port changes.

![Linking a domain to a port on a combined service in the Northflank application](https://assets.northflank.com/documentation/v1/application/domains/link-a-domain-to-a-port/custom-domain.png)

The subdomain needs valid DNS, a certificate, and a port that supports its [ingress target](https://northflank.com/docs/v1/application/domains/link-a-domain-to-a-port#choose-public-or-vpc-routing). VPC routing requires the [VPC certificate workflow](https://northflank.com/docs/v1/application/domains/certificate-generation#certificates-for-vpc-ingress) or a supported imported or wildcard certificate. You can also manage linked ports from your account's domains page.

## Learn more about domains on Northflank

- [Domains on Northflank: Manage your domains on Northflank, quickly and easily assigning them to your deployments.](/v1/application/domains/domains-on-northflank)
- [Add a domain: Add your domain name to your Northflank account.](/v1/application/domains/add-a-domain-to-your-account)
- [Use your apex domain: Use your apex (root) domain name with a Northflank service.](/v1/application/domains/add-a-domain-to-your-account#add-a-domain)
- [Link a domain to a port: How to link and unlink domains and subdomains with specific ports on your deployments.](/v1/application/domains/link-a-domain-to-a-port)
- [Use path-based routing: Route incoming traffic to different services and ports for paths on a subdomain.](/v1/application/domains/use-path-based-routing)
- [Domain registrar guides: Follow walkthroughs to add and verify domains on Cloudflare, NS1, OVH, and Namecheap.](/v1/application/domains/domains-on-northflank#custom-domains-and-subdomains)
