Blocking and allowed domains

Block IP addresses and CIDR ranges on a FormDB form, or restrict it to your own websites with allowed domains, including the Origin caveat.

This page covers two ways to reject unwanted submissions before they are stored: blocking specific IP addresses, and accepting submissions only from websites you name.

Blocked IP addresses

An IP address is the number that identifies a device or network on the internet. If the same address keeps sending junk, you can block it. Blocking is available on every plan.

Find the address

  1. Open the form's Submissions tab.
  2. Click the unwanted submission.
  3. In the Details section, copy the value next to IP address.

Block it

  1. Go to the form's Settings tab.
  2. In the Blocked IP addresses card, paste the address and press Enter.
  3. Click Save.

You can add up to 500 entries per form. Each entry is one of:

Entry

Example

Blocks

IPv4 address

203.0.113.7

That one address

IPv4 range

198.51.100.0/24

Every address in the range

IPv6 address

2001:db8::1

That one address

IPv6 range

2001:db8::/32

Every address in the range

The /24 style is called CIDR notation. It is a short way to write a block of neighbouring addresses. The number after the slash says how many leading bits are fixed, so 198.51.100.0/24 covers 198.51.100.0 to 198.51.100.255.

What a blocked visitor sees

The submission is rejected with status 403 and the code blocked. The message is "Submission blocked." Nothing is stored and no quota is used.

Keep in mind that many people can share one address, for example everyone in an office or on a mobile network. Blocking a range can block genuine visitors too. Spammers also change addresses often, so use blocking for persistent sources, and the spam filter or a captcha for general protection.

Allowed domains

Allowed domains limit a form to browser submissions that come from your own websites. If someone copies your form's endpoint into a page on another site, submissions from that page are rejected.

Every plan: Allowed domains are enforced on all plans, including Free.

Set it up

  1. Go to the form's Settings tab.
  2. In the Allowed domains card, type a domain into Domains and press Enter. Repeat for each site.
  3. Decide whether to keep Allow localhost on.
  4. Click Save.

Enter the domain only, such as example.com. If you paste a full address, FormDB removes the https:// and the path for you. You can list up to 50 domains. An empty list means any website is accepted.

How entries match

Entry

Accepts submissions from

example.com

example.com and www.example.com. Other subdomains are not accepted.

*.example.com

example.com and every subdomain, such as shop.example.com

Ports are not compared. An entry like example.com:8080 is accepted but treated the same as example.com.

Allow localhost

With Allow localhost on, which is the default, submissions from localhost, 127.0.0.1, [::1] and addresses ending in .localhost are accepted even when they are not on your list. This lets you test on your own computer. Turn it off if you want only your listed sites.

What a rejected visitor sees

The submission is rejected with status 403 and the code origin_not_allowed. The message is "Submissions from this website are not allowed." Nothing is stored.

The test form on the dashboard's Setup tab always works, whatever your allowed domains are.

The no-Origin caveat

FormDB identifies the sending website by the Origin header. This is a piece of information browsers attach to a request, naming the site the page was loaded from.

Requests that have no Origin header are always accepted, even when allowed domains are set. This includes:

  • Requests sent from a server or a script.
  • Command-line tools such as curl.
  • Any request where the browser does not send an Origin, or sends the value null.

Outside a browser, the Origin header can also be set to any value by the sender.

This means allowed domains stop other websites from using your form in their visitors' browsers. They are not a password and do not prove who is sending. Someone who knows your endpoint can still submit to it from a script. To deal with that kind of abuse, combine allowed domains with a captcha, which requires a solved challenge or a valid token with every submission, and the spam filter.

After a downgrade

Allowed domains and blocked IPs work on every plan, so moving to the Free plan does not change them.

Next steps

Ready to try it? Create a free account and send your first submission.