Skip to main content

Using Beeceptor Without DNS - Trigger Directly by IP Address

What if you're testing a network-level system where the backend can only be configured with an IP address, and DNS isn't available. Your need is to make a realistic HTTP mock backend.

HTTP

You can use Beeceptor without DNS resolution. The trick for this is to connect directly to the Beeceptor IP and pass your Beeceptor endpoint hostname in the HTTP Host header.

For example:

curl -v http://159.89.140.122/awesome-api \
-H "Host: your-service-name.proxy.beeceptor.com"

The important part is that the network destination and HTTP request are two different things.

info

Beeceptor IP addresses are infrastructure details and can change. For controlled testing environments, obtain the current IP address from our support team.

The TCP connection goes to:

159.89.140.122:80

But the HTTP request carries:

GET /awesome-api HTTP/1.1
Host: your-service-name.proxy.beeceptor.com

Think of the HTTP request as an envelope. The IP address gets the envelope to the Beeceptor infrastructure. The Host header tells Beeceptor which destination inside that infrastructure should receive it.

Beeceptor uses the endpoint subdomain component your-service-name to identify and route the request to the corresponding mock server/project. So your testing system can work without performing DNS resolution:

Your system

159.89.140.122:80

HTTP Host: your-service-name.proxy.beeceptor.com

Beeceptor virtual server handlers

HTTPS

The same approach works with HTTPS. HTTPS adds one important requirement: the hostname must also be used for TLS SNI.

With curl, --resolve lets you explicitly map the hostname to an IP without relying on DNS:

curl -v \
--resolve your-service-name.proxy.beeceptor.com:443:159.89.140.122 \
https://your-service-name.proxy.beeceptor.com/awesome-api

The connection goes to 443 port:

159.89.140.122:443

and the TLS and HTTP still use:

TLS SNI:   your-service-name.proxy.beeceptor.com
HTTP Host: your-service-name.proxy.beeceptor.com

A successful response looks like:

< HTTP/2 200
< x-beeceptor-rule-id: 0q68ciklqtk
< content-type: application/json;charset=utf-8

{
"status": "Awesome!"
}

This is useful for network-level testing environments where the backend is configured using IP addresses but the HTTP layer allows a custom Host header. In short, use the IP for network connectivity and the Beeceptor hostname in the HTTP Host header for routing.