Sitesx v0.11.0 Sitesx.Domain View Source

Sitesx.Domain manages DNS record which has detect, extract, create method on DNS Provider.

Link to this section Summary

Functions

See Sitesx.DNS.Cloudflare.create_subdomain/2

Make sure dns record using nslookup

Make sure subdomain using nslookup

Extract domain from hostname

Extract subdomain from Plug.Conn

Link to this section Functions

Link to this function create_subdomain(subdomain) View Source

See Sitesx.DNS

Link to this function create_subdomain(subdomain, params) View Source

See Sitesx.DNS.Cloudflare.create_subdomain/2.

Link to this function ensured_domain?(host) View Source
ensured_domain?(String.t) :: boolean

Make sure dns record using nslookup.

Example

Sitesx.Domain.ensured_domain? "www.example.com"
#-> ture
Link to this function ensured_subdomain?(subdomain) View Source
ensured_subdomain?(String.t) :: boolean

Make sure subdomain using nslookup.

Example

Sitesx.Domain.ensured_subdomain? "www"
#-> false
Link to this function extract_domain(host) View Source
extract_domain(String.t) :: String.t | nil

Extract domain from hostname

Example

Sitesx.Domain.extract_domain "www.example.com"
#-> "example"
Link to this function extract_subdomain(conn) View Source
extract_subdomain(Plug.Conn.t) :: String.t | nil

Extract subdomain from Plug.Conn

Example

Sitesx.Domain.extract_domain conn
#-> "www"