repo_description: The AWS Provider enables Terraform to manage AWS resources.
repo_topics: aws terraform terraform-provider
code: // Copyright IBM Corp. 2014, 2026
  // SPDX-License-Identifier: MPL-2.0
  
  package dns
  
  import (
  	"slices"
  	"strings"
  )
  
  // Reverse switches a DNS hostname to reverse DNS and vice-versa.
  func Reverse(hostname string) string {
  	parts := strings.Split(hostname, ".")
  	slices.Reverse(parts)
  
  	return strings.Join(parts, ".")
  }
  