ChatBotCustomDomainDNS Model

class smarter.apps.chatbot.models.ChatBotCustomDomainDNS(*args, **kwargs)[source]

Bases: TimestampedModel

Represents a DNS record associated with a custom domain for a ChatBot within the Smarter platform.

This model is responsible for storing and managing individual DNS records that are linked to a specific ChatBotCustomDomain. Each instance of this model corresponds to a single DNS record, such as an A, CNAME, or TXT record, which is required for the proper operation and verification of a chatbot’s custom domain.

The primary use case for this model is to facilitate the automation and tracking of DNS configurations necessary for deploying chatbots on customer-branded domains. By maintaining a record of all DNS entries related to a chatbot’s custom domain, the platform can automate DNS verification, support trouble shooting, and ensure that all required DNS records are present and correctly configured.

Key Features

  • Associates each DNS record with a specific ChatBotCustomDomain.

  • Stores the record name, type (such as A, CNAME, TXT), value, and TTL (time-to-live).

  • Supports management of multiple DNS records per custom domain, enabling complex DNS setups.

  • Facilitates DNS verification workflows and integration with external DNS providers (e.g., AWS Route 53).

Usage Scenarios

  • When deploying a chatbot to a custom domain, instances of this model are created to represent the required DNS records (e.g., for domain verification, routing, or certificate issuance).

  • The platform can query this model to retrieve all DNS records associated with a given custom domain, enabling automated checks and updates.

  • Used internally by deployment and verification processes to track the status and configuration of DNS records for each chatbot custom domain.

Integration

  • Closely linked to ChatBotCustomDomain, providing a one-to-many relationship between a custom domain and its DNS records.

  • Referenced by deployment, verification, and trouble shooting workflows within the Smarter platform.

Notes

  • This model is intended for internal use and is not exposed directly to end users.

  • The record fields are validated to ensure compliance with DNS standards.

  • TTL defaults to 600 seconds but can be customized as needed for specific DNS requirements.

Example

# Create a new DNS record for a chatbot custom domain
dns_record = ChatBotCustomDomainDNS.objects.create(
    custom_domain=my_custom_domain,
    record_name="_acme-challenge.chatbot.example.com",
    record_type="TXT",
    record_value="abc123xyz",
    record_ttl=600,
)

# Retrieve all DNS records for a custom domain
records = ChatBotCustomDomainDNS.objects.filter(custom_domain=my_custom_domain)
Parameters:
  • id (BigAutoField) – Primary key: ID

  • created_at (DateTimeField) – Created at

  • updated_at (DateTimeField) – Updated at

  • record_name (CharField) –

    Record name

    The name of the DNS record (e.g., “_acme-challenge.chatbot.example.com”). Example: “_acme-challenge.chatbot.example.com”

  • record_type (CharField) –

    Record type

    The type of DNS record (e.g., “A”, “CNAME”, “TXT”). Example: “TXT”

  • record_value (CharField) –

    Record value

    The value of the DNS record (e.g., “abc123xyz”). Example: “abc123xyz”

  • record_ttl (IntegerField) –

    Record ttl

    The time-to-live (TTL) for the DNS record, in seconds. Example: 600

Relationship fields:

Parameters:

custom_domain (ForeignKey to ChatBotCustomDomain) –

Custom domain (related name: chatbotcustomdomaindns)

The custom domain associated with this ChatBot. Example: ChatBotCustomDomain(id=1, domain=”example.com”)

Reverse relationships:

Parameters:

chatbot (Reverse ForeignKey from ChatBot) –

All ChatBots of this chat bot custom domain dns (related name of subdomain)

The ChatBot instance associated with this function. Example: ChatBot(id=1, name=”my-chatbot”)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

chatbot_set

Reverse ForeignKey from ChatBot

All ChatBots of this chat bot custom domain dns (related name of subdomain)

Type:

Type

created_at

DateTimeField

Created at

Timestamp indicating when the model instance was created. This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.

Type:

Type

custom_domain

ForeignKey to ChatBotCustomDomain

Custom domain (related name: chatbotcustomdomaindns)

The ChatBotCustomDomain that this DNS record is associated with. Example: ChatBotCustomDomain(id=1, domain=”example.com”)

Type:

Type

custom_domain_id

Internal field, use custom_domain instead.

id

BigAutoField

Primary key: ID

Type:

Type

objects = <django.db.models.Manager object>
record_name

CharField

Record name

The name of the DNS record (e.g., “_acme-challenge.chatbot.example.com”). Example: “_acme-challenge.chatbot.example.com”

Type:

Type

record_ttl

IntegerField

Record ttl

The time-to-live (TTL) for the DNS record, in seconds. Example: 600

Type:

Type

record_type

CharField

Record type

The type of DNS record (e.g., “A”, “CNAME”, “TXT”). Example: “TXT”

Type:

Type

record_value

CharField

Record value

The value of the DNS record (e.g., “abc123xyz”). Example: “abc123xyz”

Type:

Type

updated_at

DateTimeField

Updated at

Timestamp indicating when the model instance was last updated. This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.

Type:

Type