Skip to content

CICD-321 · DNS resolution testing ​

Encyclopedia · Advanced networking and API testing · All snippets

Previous · CICD-320 · Next · CICD-322

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites authorized test service, known endpoint or local fixture and the named test CLI.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters SERVICE_HOST.

2. Copy the snippet ​

bash
getent ahosts "${SERVICE_HOST:?}"
dig +time=2 +tries=1 "$SERVICE_HOST" A

3. How it works ​

The command resolves the name using the configured system name service of the machine or container running the step.

4. Verify the result ​

Check both libc and DNS resolver behaviour. Search suffix and record type can explain different results.

Validation syntax-validated (Bash parse). Status definitions.