-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple IPs in A/AAAA records #66
Labels
enhancement
New feature or request
Comments
@mr-karan try separating the IPs with new line characters |
@aymanbagabas Tried that, doesn't seem to work: package main
import (
"context"
"fmt"
"log"
"math/rand"
"net"
"strings"
"github.com/libdns/libdns"
route53 "github.com/libdns/route53"
)
func main() {
p := &route53.Provider{}
ctx := context.Background()
ips := []string{}
for i := 0; i < 3; i++ {
// Generate a random IP address
ip := net.IPv4(
byte(rand.Intn(256)),
byte(rand.Intn(256)),
byte(rand.Intn(256)),
byte(rand.Intn(256)),
).String()
ips = append(ips, ip)
}
ipsStr := strings.Join(ips, "\n")
fmt.Println("IPs:", ipsStr)
_, err := p.SetRecords(ctx, "test.internal.", []libdns.Record{
{
Name: "libdns-r53-debug",
Value: ipsStr,
Type: "A",
},
})
if err != nil {
log.Fatalln(err)
}
fmt.Println("Set record with IPs:", ipsStr)
} Output:
AWS CLI equivalent:
The version which works (correct way):
Hope this helps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current implementation doesn't support multiple IPs. The last
value
of the record for a given hostname is overwritten because of this code:https://github.com/libdns/route53/blob/068570957413f156f1795373ea9414c0db6e6197/provider.go#L98C1-L104C3
Can multiple IP support be considered as well?
The text was updated successfully, but these errors were encountered: