Simulate DNS Faults

    DNSChaos is used to simulate wrong DNS responses. For example, DNSChaos can return an error or return a random IP address when receiving a DNS request.

    Before creating a DNSChaos experiment using Chaos Mesh, you need to deploy a special DNS service to inject faults:

    After executing the above commands, check if the DNS service status is normal:

    Make sure that the Pod status is .

    1. Currently, DNSChaos only supports record types A and AAAA.

    1. Open Chaos Dashboard, and click NEW EXPERIMENT on the page to create a new experiment:

    2. In the Choose a Target area, choose DNS FAULT and select a specific behavior, such as ERROR. Then fill out the matching rules.

      DNSChaos Experiment

      According to the matching rules configured in the screenshot, the DNS FAULT takes effect for domains including google.com, chaos-mesh.org, and github.com, which means that an error will be returned when a DNS request is sent to these three domains. For details of specific matching rules, refer to the description of the patterns field in Configuration Description.

    3. Submit the experiment information.

    1. Write the experiment configuration to the dnschaos.yaml file:

      This configuration can take effect for domains including google.com, chaos-mesh.org, and github.com, which means that an IP address will be returned when a DNS request is sent to these three domains. For specific matching rules, refer to the patterns description in .

    2. After the configuration file is prepared, use to create an experiment:

    note" class="reference-link">note
    • When patterns is not configured, faults will be injected for all domains.