What is an SRV record?

Home / Everything About / Everything About Domains / What is an SRV record?

If you have been reading through the chapters on DNS records, you know that each record type has a specific job. An A record points your domain to a server's IP address. A CNAME record points one domain name to another. An SRV record does something neither of those can. It tells the internet not just where to go, but which service to connect to and which port to use when it gets there.

What does SRV stand for?

SRV stands for service. The name fits. While other DNS records point traffic to a server in general, an SRV record points traffic to a specific service running on that server. Think of it like the difference between giving someone your office building's address and giving them your building address plus the floor number, room number, and the name of the person they need to ask for.

What does an SRV record do?

An SRV record maps a specific service and protocol to a server and port. When an application needs to find a particular service on your domain, it looks up the SRV record in your DNS to find out three things.

  • Which server is running that service
  • Which port the service is listening on
  • How to prioritize and balance traffic if more than one server offers the same service

This makes SRV records useful for services that do not run on a standard web port. A website loads over port 80 or 443, and an A record handles that fine. But a voice call or an internal messaging service might run on a completely different port and server. The SRV record connects the dots.

What does an SRV record look like?

An SRV record has more fields than most DNS records. Here is what each part means.

  • Service is the name of the service, written with an underscore in front. For example, _sip for a voice calling service or _xmpp for a messaging service
  • Protocol is the network protocol the service uses, also with an underscore. The two most common values are _tcp and _udp
  • Priority is a number that tells clients which server to try first. Lower numbers get tried before higher ones
  • Weight is used when two servers share the same priority. A higher weight means that server gets a larger share of the traffic
  • Port is the specific port number the service is running on
  • Target is the hostname of the server that provides the service

A typical SRV record in your DNS panel might look something like this.

  • Name set to _sip._tcp.yourdomain.com
  • Type set to SRV
  • Priority set to 10
  • Weight set to 60
  • Port set to 5060
  • Target set to sipserver.yourdomain.com

That record says one thing. When a device needs the SIP voice service for your domain using TCP, it should connect to sipserver.yourdomain.com on port 5060.

When do you need an SRV record?

For most brands running a standard website, an SRV record is not something you will ever need to touch. It is not part of getting a website online, setting up email, or connecting a custom domain.

SRV records come into play when you use services that rely on them for automatic discovery. Here are the situations where they tend to show up.

  • Voice over IP (VoIP) services that use the SIP protocol to route calls through your domain
  • Messaging and chat services that use protocols like XMPP to find the right server
  • Enterprise tools that need to locate a specific service across a network, like directory services or authentication servers
  • Gaming servers or collaboration tools that connect clients to a particular port on a particular machine

If a service you are setting up asks you to add an SRV record to your DNS, that is the sign you need one. If nobody has asked you to add one, you almost certainly do not need it.

How is an SRV record different from an A record or a CNAME record?

An A record connects a domain name to an IP address. It does not specify a port or a service. A CNAME record connects one domain name to another. It also does not specify a port or service.

An SRV record goes further. It specifies the service name, the protocol, the port, the target server, and even how to handle load balancing if multiple servers exist. It is the most detailed of the three, which is why it is used for services that need that level of precision.

If your DNS is a phone book, an A record gives someone a phone number. A CNAME says "look up this other name instead." An SRV record gives a phone number plus the extension, the department, and instructions on who to call first if the line is busy.

Does a typical brand need an SRV record?

Honestly, probably not. If you are running a website, sending email, and using standard online tools, the DNS records that matter to you are A records, CNAME records, MX records, and TXT records. Those cover websites, email, and domain verification for the vast majority of setups.

SRV records live in the territory of specialized services. But it is still worth knowing what one is. If a service you are setting up hands you DNS instructions that include an SRV record, you will know what it is, what the fields mean, and how to add it without second-guessing yourself.

How to add an SRV record

Adding an SRV record follows the same general process as adding any other DNS record. If you have added a TXT or A record before, this will feel familiar.

  1. Log in to the DNS management panel where your domain's nameservers are set. This is usually your registrar or your hosting provider
  2. Navigate to the DNS records section or DNS zone editor
  3. Click the option to add a new record and select SRV as the record type
  4. Fill in the service name, protocol, priority, weight, port, and target using the values provided by the service you are setting up
  5. Save the record

DNS changes can take anywhere from a few minutes to 48 hours to propagate, though most take effect within a few hours. For more on how that propagation works, read the chapter on how DNS works.

How WEMASY handles SRV records

WEMASY manages DNS, hosting, and SSL for every website built on the platform and configures the DNS records you need automatically. SRV records are not part of a typical WEMASY website setup because the services that require them sit outside what a website platform handles.

If you use a service that requires an SRV record on your domain, you would add that record through your domain registrar's DNS panel. WEMASY's setup does not interfere with additional DNS records you add at the registrar level. See what is included in each plan at WEMASY pricing.

What comes next

Now that you know how an SRV record directs traffic to specific services on your domain, the next chapter covers SOA records. An SOA record identifies the primary authority for your DNS zone and controls how DNS information is shared and refreshed across servers.

Frequently asked questions

Can you have multiple SRV records for the same service?

Does an SRV record affect how your website loads?

What happens if an SRV record points to a server that is offline?

Is an SRV record the same as a port forwarding rule?

Do all applications support SRV record lookups?