# is\_letsencrypt\_valid\_hostname

Source: https://zotonic.com/docs/1830/is_letsencrypt_valid_hostname

URI: https://zotonic.com/id/1830

Language: en



Test if a hostname can be used for a Let’s Encrypt certificate.

Criteria are:

1. Does resolve using DNS
2. The resolved address is not a LAN address
3. The address is reachable
4. And the current site is listening for the hostname on that address

The site must listen on port 80 for connections.

For example, check if the current site is reachable as *example.com*:

```django
{% if "example.com"|is_letsencrypt_valid_hostname %}
    Wow, this site is example.com!?!
{% endif %}
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1830?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1830?language=en>)
