No release in over 3 years
Low commit activity in last 3 years
Identify subdomain names that should be reserved
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

ReservedSubdomain

Gem Version Gem downloads Build Status Maintainability Test Coverage Dependency Status security Codacy Badge

ReservedSubdomain is a Ruby gem that checks whether a proposed subdomain should be a reserved name.

It checks for common patterns such as www or mail. It checks all gTLDs. It checks some common language and country codes.

Installation

Add this line to your application's Gemfile:

gem 'reserved_subdomain'

Usage

ReservedSubdomain.new('www').reserved? # => true

Reserved subdomains

The actual subdomain names that are marked as reserved can be found in the text files in the literals directory.

Configuration

Each time you use ReservedSubdomain it loads the list of reserved names from a file. This can be slow if you're doing these checks frequently.

In this case you can set the environment variable RESERVED_SUBDOMAIN_PRELOAD to "true" and the list will be preloaded.

Of course if you preload the list it will stay memory-resident and take up a significant amount of room. Your call.

Contributing

  1. Fork the repo into your own account.
  2. Copy the Gemfile.local.example to Gemfile.local and edit as you see fit.
  3. Organize your changes into easy-to-understand commits.
  4. Submit a pull request for me to merge.

If you need to update the text files, run the bin/build_literals job to ensure there are no duplicates.