
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
.NET REST client for the Gandi v5 API
This library allows you to create, read, update, and delete LiveDNS DNS records in your Gandi domains.
It's similar to G6.GandiLiveDns, but it's compatible with both Personal Access Token and API Key authentication, public types have interfaces so you can mock and actually test your dependent code, and it's compatible with a wider variety of runtimes.
ns-*-*.gandi.net
)*.dns.gandi.net
) is incompatible; you will need to migrate to LiveDNSThis library is available in the Gandi
package on NuGet Gallery.
dotnet add package Gandi
GandiClient
instance, for example if the old token expires and a new one is written to a configuration file that reloads on changes, you can set the IGandiClient.AuthToken
property any time during the lifetime of the instance.GandiClient
, passing the Personal Access Token or API Key to the constructor.
using Gandi;
using IGandiClient gandi = new GandiClient("<personal access token or API key>");
HttpClient
instance used by GandiClient
if you want to configure timeouts, extra request headers, or add requests or response filters.HttpClient
, you can pass it to the GandiClient(HttpClient?)
constructor. Make sure the HttpClient
's HttpMessageHandler
inherits from IUnfuckedHttpHandler
(one easy way to do this is for HttpClient
to be an UnfuckedHttpClient
) so that client request authentication filters and JSON serialization work correctly. To wrap your own HttpMessageHandler
instance (such as a customized SocketsHttpHandler
or DelegatingHandler
), pass it to the UnfuckedHttpHandler(HttpMessageHandler?)
constructor.Get a LiveDNS API client for your second-level/registered domain name using IGandiClient.LiveDns(string)
. This object has async methods on it that perform HTTP calls to Gandi's LiveDNS API.
ILiveDns liveDns = gandi.LiveDns("mydomain.com");
Return a list of all DNS records in the domain, optionally filtered by name or type (A, CNAME, etc). If no results are found, returns an empty enumeration.
ILiveDns liveDns = gandi.LiveDns("mydomain.com");
IEnumerable<DnsRecord> allRecords = await liveDns.List();
IEnumerable<DnsRecord> cnames = await liveDns.List(type: RecordType.CNAME);
IEnumerable<DnsRecord> www = await liveDns.List(name: "www");
Return one DNS record in the domain with the given name and type, or null
if it was not found.
DnsRecord? wwwRecord = await liveDns.Get(RecordType.A, "www");
Set a DNS record's value, automatically creating it if it didn't already exist, or modifying it if it already existed (upserting). To specify a record at the root/origin of your domain, pass @
as the name. The time to live is optional, defaults to 3 hours if you set it to null
, and is clipped to the allowed range [5 minutes, 30 days]. You must supply at least one value for the record.
await liveDns.Set(new DnsRecord(RecordType.A, "www", TimeToLive.FromHours(1), "1.2.3.4"));
Remove a record with the given name and optionally the given type. If the type is not specified, records of all types with the given name are deleted. This method returns successfully even if the record did not exist, because either way it doesn't exist after the method completes, so it's in the desired state.
await liveDns.Delete(RecordTytpe.CNAME, "www");
using IGandiClient gandi = new GandiClient(personalAccessToken);
await gandi.LiveDns("aldaviva.com").Set(new DnsRecord(RecordType.A, "west", DnsRecord.MinTimeToLive, "172.11.57.29"));
using IGandiClient gandi = new GandiClient(personalAccessToken);
ILiveDns liveDns = gandi.LiveDns("aldaviva.com");
// Generate a new ACME order, authorization, and DNS challenge
DnsRecord txtRecord = new(RecordType.TXT, "_acme-challenge.west", DnsRecord.MinTimeToLive, dnsChallengeValue);
await liveDns.Set(txtRecord);
// Repeatedly ask certificate authority to validate the challenge until its status is valid
await liveDns.Delete(txtRecord);
// Generate a private key and certificate signing request, then request a certificate chain from the CA
FAQs
Gandi LiveDNS API client that can create, read, update, and delete DNS records
We found that gandi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.