Add or modify DNS records to Sourcegraph owned domains
Sourcegraph follows an Infrastructure as Code (IaC) model. To make changes to Sourcegraph owned DNS records you should make the change to the code in Terraform in our sourcegraph/infrastructure repo.
-
Navigate to the
dns
folder -
Create a file, add the record near the most relevant DNS entries, or modify the existing record
- For domains with a large number of TXT records like
Sourcegraph.com, we typically create a file
sourcegraph.$TXT_PROVIDER.tf
- For domains with a large number of TXT records like
Sourcegraph.com, we typically create a file
-
Create a pull request in the repo with your changes
-
Open Buildkite
- Check status of
ci/terraform.sh dns
job and it should pass without error. - If there is any error, you should consult the logs or reach out to
#cloud-devops
- Check status of
-
Wait for Buildkite to finish your build
-
Get approve from the cloud-devops team
-
terraform apply
the PR or drop a message in #cloud-devops and DevOps team will apply it for you (if you’re not a DevOps or Security teammate, you most likely don’t have sufficient access to apply thedns
terraform module) -
Merge the PR after the apply succeeds
FAQ
Are you adding a DNS record for a Netlify site?
You should create a CNAME record pointing to sourcegraph.netlifyglobalcdn.com
. In terraform, it looks something like
resource "cloudflare_record" "about-sourcegraph-com" {
zone_id = data.cloudflare_zones.sourcegraph_com.zones[0].id
name = "about"
type = "CNAME"
value = var.netlify-enterprise-cdn-cname
proxied = false
}