Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 9 min read

Blocking Restricted Sites in a Mobile Network: DNS Redirection or DPI, and What the Rules Document

A network operator that blocks restricted sites can act on the Domain Name System (DNS) or on the traffic itself with deep packet inspection (DPI). With DNS, the operator's resolver can give a changed answer for a blocke

A network operator that blocks restricted sites can act on the Domain Name System (DNS) or on the traffic itself with deep packet inspection (DPI). With DNS, the operator's resolver can give a changed answer for a blocked name. With DPI, a filter inspects the flow itself. For plain Hypertext Transfer Protocol (HTTP) traffic, it can read the request and compare the requested Uniform Resource Identifier (URI) with a list. For encrypted traffic, it works with the fields that stay unencrypted. This post compares the two methods and shows where each falls short. It then summarizes what the 3rd Generation Partnership Project (3GPP) specifications say about DNS and redirection in the mobile core, and what rules in Africa, the Middle East and Latin America document.

How does DNS redirection block a site?

DNS blocking changes what a resolver answers for a name. The ICANN Security and Stability Advisory Committee (SSAC) report SAC127 (2025) describes redirection as one option: the resolver returns the address of a remediation server. Others are an answer that the domain does not exist, or no answer. A party in the path can intercept queries and answer synthetically.

With redirection, the remediation server displays a message saying the site is blocked. NXDOMAIN (non-existent domain) is the form SAC127 calls the most common among replies that give no actual resolution. REFUSED and SERVFAIL are two other replies of this kind. Silence has a drawback: the lack of a response might, under certain circumstances, make the resolver unusable from the querier's perspective.

RFC 7754 from the Internet Architecture Board (IAB, 2016) notes that network operators and enterprises "may be capable of conducting blocking using their own DNS resolvers".

SAC127 notes that users may not know a block is in place and can read it as a site outage. It recommends that operators of recursive servers use Extended DNS Errors (EDE) to indicate that blocking is taking place. Four of the codes defined in RFC 8914 relate to blocklists and forged answers:

EDE code Meaning in RFC 8914
15, Blocked The domain is on a blocklist because of an internal security policy imposed by the operator of the server that resolves or forwards the query
16, Censored The domain is on a blocklist because of an external requirement imposed by an entity other than that operator
17, Filtered The domain is on a blocklist as requested by the client
4, Forged Answer For policy reasons, such as legal obligation or malware filtering, an answer was forged. It should be used when an answer is still provided, not when failure codes are returned

RFC 8914 says Extended DNS Errors are diagnostic information and must not alter DNS protocol processing. Whether, and how, a resolver passes the information on to its client is implementation dependent.

How does DPI block a site?

DPI blocks by inspecting the flow itself. For plain HTTP, a web filter reads the request, takes the requested URI and compares it with a list. Most web traffic now uses HTTPS, where the request is encrypted. There the filter works with fields that stay unencrypted, such as the server name in the TLS handshake (Server Name Indication, SNI), the server certificate and the server’s IP address. RFC 7754 says DPI-type blocking on application-layer attributes can be potentially more granular and less likely to cause collateral damage than blocking all traffic associated with an address.

RFC 7754 describes stateless packet filters as blocking by content-neutral rules, for example by ports, protocols or network-layer addresses. Blocking all traffic associated with an address can impact unrelated occupants of that address. The RFC also notes that blocking based on IP addresses can be trivial to circumvent.

The same RFC adds that more narrowly focused targeting "may be more complex, less efficient, or easier to circumvent" than filtering that sweeps more broadly.

Where does each method fall short?

Per SAC127, a user can bypass resolver-based blocking by configuring another recursive resolver, unless access to it is blocked or manipulated on the path. SAC127 says DNS blocking may never be 100% effective. RFC 7754 calls network-based blocking (packet filtering, DPI) effective only in a fairly constrained set of circumstances.

RFC 7754 lists IP literals in URIs as one way to circumvent DNS filtering. SAC127 notes that the content typically remains available at the original IP address. SAC127 also notes that if a party blocks example.TLD, it blocks everything at and beneath that domain.

SAC127 says DNS encryption such as DNS over HTTPS (DoH) and DNS over Transport Layer Security (DoT) can be used to bypass on-path interception and manipulation of the DNS. RFC 8484 says DoH encrypts DNS traffic and requires authentication of the server.

For a domain signed with DNS Security Extensions (DNSSEC), a substituted response lacks a valid signature. A client can detect it if it validates DNSSEC itself, which SAC127 calls rare. When the validating resolver is also the one that blocks, clients have no means to detect the trust violation.

DPI has its own limits. RFC 7754 says stateful packet filtering and DPI often run into technical issues that limit their viability in practice. In a network with many egress points, asymmetric routing can mean that an intermediary sees only one half of a communication. If content is encrypted with TLS or IPsec, RFC 7754 notes, the intermediary would need to decrypt the packets to examine application content. Both methods depend on the blocklist: SAC127 says parties may make errors in the list of domains, IP addresses or URLs they block, which may affect unrelated parties.

What do the 3GPP specifications say about DNS and redirection?

The 3GPP specifications describe two things in the mobile core. When a phone sets up a connection, Protocol Configuration Options (PCO) can carry DNS server addresses. Policy and Charging Control (PCC) rules can close a flow with a gate or redirect detected application traffic. The definition of redirection gives a top-up or service provisioning page as its example.

In TS 24.008 the PCO element carries DNS server addresses in separate containers, and the phone asks with DNS Server IPv4 Address Request and IPv6 Address Request containers. In the Evolved Packet System (EPS), TS 23.401 says PCO go between the phone and the packet data network gateway (PGW) and pass transparently through the nodes in between.

TS 23.203 defines gating control as the process of blocking or allowing packets that belong to a service data flow or a detected application's traffic. Application detection is done by the Traffic Detection Function (TDF) or by a Policy and Charging Enforcement Function (PCEF) enhanced with Application Detection and Control (ADC). Where the TDF cannot give the Policy and Charging Rules Function (PCRF) a service data flow description, TS 23.203 (clause 6.2.9.1) says the TDF itself performs gating, redirection, bandwidth limitation and charging for the detected applications.

Gate Redirect
What the rule says Whether the traffic may pass (gate open) or shall be discarded (gate closed): a service data flow at the PCEF under a PCC rule, or a detected application at the TDF under an ADC rule The detected service traffic goes to an application server. The definition's example is a top-up or service provisioning page
On Gx (Diameter) If the gate is closed, all packets of the related IP flows are dropped A PCEF enhanced with ADC redirects the detected application's uplink traffic to the redirect address of the rule

The redirect address can be given as IPv4, IPv6, URL or Session Initiation Protocol (SIP) URI.

In the 5G core, TS 23.501 (clause 5.8.2.8.3) says the redirection of uplink application traffic may be enforced either in the Session Management Function (SMF) or directly in the User Plane Function (UPF).

What do rules in Africa, the Middle East and Latin America document?

Four documents are summarized here, from the UAE, Nigeria, Brazil and Peru. The UAE and Nigerian documents come from telecom regulators; the Brazilian and Peruvian ones are a provisional measure and a law. None uses the term DNS or DPI. Each sets the result the provider must reach and leaves most of the technique to the operator or the authority. Brazil routes orders on name resolution under .br to the body that manages the domain, and names redirection. Peru is the only one that names IP blocking. The UAE identifies prohibited content by URL, pattern or digital footprint and requires a blocking message. None sets separate blocking rules for mobile networks.

The UAE Telecommunications and Digital Government Regulatory Authority (TDRA) set out its Internet Access Management Regulatory Policy in version 1.1 of 19 April 2017. Licensees block prohibited content. The policy says the scope of such content is identified "by its URL, pattern, or digital footprint", or by any technique that does not impair unprohibited content. A user who tries to open prohibited content gets a blocking message, "according to their technical capabilities". The policy names no DNS or DPI method. The prohibited categories are listed in an annex.

Nigeria's regulator, the Nigerian Communications Commission (NCC), issued its Internet Code of Practice 2026 on 13 February 2026. When the NCC finds reported content unlawful, it issues a takedown notice to internet access service providers "to deny or disable access to the content", and they must comply within 24 hours. A provider must also have measures for the immediate blocking of access to child sexual abuse content once the NCC notifies it. The Code does not say how to block. It forbids blocking lawful content, except for reasonable network management.

As of November 2026, Brazil's provisional measure MP 1.394 of 25 September 2026 bans fixed-odds betting. It lets the Ministry of Finance and the Ministry of Justice and Public Security request blocking or redirection of the sites that offer it (from the Portuguese text). The telecom regulator Anatel receives the orders and distributes them to providers of internet access. The Brazilian Internet Steering Committee (CGI.br) receives the orders that concern name resolution under the .br domain. Anatel and CGI.br may define the most appropriate technique. A provisional measure has the force of law from publication but expires unless Congress converts it into a law; Congress has not yet done so, and the deadline runs to 4 March 2027.

Peru's Law 31557 on remote gaming and sports betting lets the Ministry of Foreign Trade and Tourism (MINCETUR) require the blocking of URLs, IP addresses, web pages and apps, and of payment channels (from the Spanish text). A complementary provision obliges the Ministry of Transport and Communications to carry out such blocks at MINCETUR's request. The law does not name DNS or DPI.

URL Filtering on our platform

Our URL Filtering option filters web resources by regulatory blacklists or by lists the operator sets up itself. It works together with Stingray Service Gateway, our platform built on DPI. The platform can download blocklists from our cloud service and update them automatically. A national register that our cloud does not carry, such as those described above, the operator connects as its own list, loaded from an address it specifies. Our traffic filtering page describes illegal content as including pornography and online casinos.

Lists can hold URLs for HTTP, and server names (SNI), certificate names (Common Name) and IP addresses for HTTPS. The platform filters traffic from mobile devices, such as iOS and Android, and from proxy servers. Besides the operator’s own lists, it supports filtering by category, with a daily update of the category list. On a blocked URL, our platform can redirect the user to a page set by the operator, for HTTP traffic. A blocked HTTPS connection is closed without a redirect.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.