Ping Name Service (PNS)
Register and manage your .SOL domains using SNS
Register, resolve, and manage .SOL domains using the Ping Name Service. The documentation includes domain name registrations, resolution, and management functions.
Domain Management
Register new domains
Resolve domains to addresses
Get primary domains
List registered domains
Domain Operations
Custom space allocation
Domain resolution
Multi-TLD support
Primary domain lookup
Copy
const signature = await agent.methods.registerDomain(
"mydomain", // Domain name (without .sol)
1 // Space in KB (optional)
);
Copy
const address = await agent.methods.resolveSolDomain("mydomain.sol");
console.log("Owner:", address.toString());
Copy
const domain = await agent.methods.getPrimaryDomain(
new PublicKey("owner-address")
);
Copy
const domains = await agent.methods.getAllRegisteredAllDomains();
console.log("Registered domains:", domains);
Copy
"Register mydomain.sol with 2KB storage"
"Look up the owner of vitalik.sol"
"Get the primary domain for this wallet"
"Find all registered .sol domains"
Copy
{
"name": "mydomain",
"spaceKB": 2
}
Copy
{
"domain": "vitalik.sol"
}
Copy
interface RegistrationParams {
name: string; // Domain name
spaceKB?: number; // Storage space (max 10KB)
}
// Features
- Automatic USDC payment
- Space validation
- Transaction bundling
- Associated token handling
Copy
interface ResolutionParams {
domain: string; // Domain to resolve
}
// Features
- .sol suffix handling
- Error recovery
- Stale check
- Multi-TLD support
Copy
interface PrimaryDomainResponse {
reverse: string; // Domain name
stale: boolean; // Staleness status
}
// Features
- Staleness check
- Error handling
- Reverse lookup
Copy
try {
const result = await agent.methods.registerDomain("mydomain");
} catch (error) {
if (error.message.includes("Maximum domain size")) {
// Handle size limit exceeded
} else if (error.message.includes("insufficient funds")) {
// Handle payment issues
}
}
Domain Registration
Choose appropriate space
Verify domain availability
Check USDC balance
Plan for renewals
Domain Resolution
Handle missing domains
Check staleness
Implement caching
Validate inputs
Domain Management
Monitor expiration
Update records
Backup settings
Regular validation
Performance
Cache resolutions
Batch operations
Handle timeouts
Monitor errors
Registration
Insufficient USDC
Name taken
Invalid characters
Space limits
Resolution
Stale records
Invalid domains
Missing records
Network issues
Management
Expired domains
Update failures
Permission issues
Sync problems
Copy
{
status: "success",
message: "Domain registered successfully",
transaction: "5UfgJ5vVZxUx...",
domain: "mydomain.sol",
spaceKB: 1
}
Copy
{
status: "success",
message: "Domain resolved successfully",
publicKey: "7nxQB..."
}
Basic Domain
1KB
With Records
2KB
Full Profile
5KB
Maximum
10KB
getBalance
: Check USDC balancetransfer
: Transfer domainscreateAssociatedTokenAccount
: Setup USDCgetAllDomainsTLDs
: List available TLDs
Registration Cost
Based on name length
Space allocation fee
USDC payment required
Renewal considerations
Resolution Process
Caching recommended
Handle timeouts
Validate responses
Multiple attempts
Management Tips
Regular validation
Backup records
Monitor expiration
Update settings
Last updated