← Back to all articles Infrastructure & .ma domain 9 min

.ma domain name (ANRT) and web hosting in Morocco: technical checklist

ANRT registration rules, choosing between .ma and .com, hosting benchmarks for low TTFB in Morocco, essential DNS authentication records, and zero-downtime cutover steps.

When launching or redesigning a website in Morocco, two foundational infrastructure choices shape long-term maintainability: domain registration (.ma vs .com) and web hosting architecture.

Common pitfalls include domains registered under a third-party agency account rather than the legal business owner, missing DNS email authentication records that send transactional messages to spam, or under-resourced servers that inflate Time to First Byte (TTFB) and hurt Core Web Vitals.

This technical guide covers ANRT registration rules for .ma domains, objective hosting criteria for Moroccan traffic, required DNS records, and a clean cutover checklist.

1. How .ma domain registration works under ANRT rules

The .ma country-code top-level domain (ccTLD) is regulated by Morocco’s National Telecommunications Regulatory Agency (ANRT) through its registry (registre.ma). Registrations are processed exclusively through ANRT-accredited registrars, not directly with the regulator.

Key governance checks before registering:

  • Direct legal ownership: Register the domain under your company’s legal name (with trade register/ICE details where requested) or your own name, using an administrative email controlled by the organization—never an external contractor’s personal inbox.
  • Available extensions: Standard .ma domains are broadly accessible to Moroccan and international entities through accredited registrars. Specialized second-level spaces also exist (.co.ma for commercial entities, .org.ma for associations, .net.ma for network operators, and restricted namespaces such as .ac.ma or .gov.ma).
  • Transfer authorization code (Auth-Info / EPP): Moving a .ma domain between accredited registrars requires an Auth-Info code from the current registrar. Keeping existing nameservers (NS) unchanged during the administrative transfer avoids web or email interruption.
  • Renewal tracking: Enable auto-renewal and monitor expiration alerts. Expired .ma domains enter a suspension window before full deletion and release.
Ali Ouarzazi
Domain ownership: contractual checkpoint
Always retain full registrar account access and confirm on the official registre.ma WHOIS lookup that your organization is listed as the registrant. Recovering a domain registered under a former vendor’s entity often creates avoidable legal and operational delays.

2. Choosing between .ma and .com for search visibility in Morocco

From a search engine perspective, Google treats .ma as an explicit country-target signal for Morocco, whereas .com is a generic extension suitable for multi-country or international audiences.

Practical criteria to decide:

  • Primarily Moroccan customer base (local clinics, legal or accounting firms, domestic real estate, national retail): A .ma domain communicates local presence to users and provides automatic geographic targeting.
  • Cross-border hospitality, export, or SaaS (riads in Marrakech targeting European travelers, tour operators, software companies): A .com domain organized with /fr/ and /en/ subfolders and reciprocal hreflang tags provides a geographically neutral base for international queries.
  • Brand protection without duplicate content: Many companies register both .ma and .com to prevent brand misuse. Never serve identical live websites on both domains simultaneously: designate one canonical primary domain (consistently choosing www. or apex) and configure a permanent 301 redirect from the secondary domain.

3. Technical criteria for choosing web hosting for Morocco

Server geography, software stack (web server, PHP or Node.js runtime, server-side caching), and network peering directly influence Time to First Byte (TTFB) for visitors in Marrakech, Casablanca, or Rabat as well as international users.

Evaluate hosting providers using verifiable engineering specifications:

  • Network latency and server location: Hosting in Morocco shortens domestic routing when paired with solid local operator peering. Western European datacenters (Paris, Madrid, or Frankfurt) typically add around 35–55 ms round-trip latency to Morocco while providing mature NVMe hardware and low latency for European travelers or B2B clients.
  • Modern runtime stack: Look for HTTP/2 or HTTP/3 (QUIC), TLS 1.3, NVMe SSD storage, PHP 8.2/8.3 for WordPress or Laravel (or Node.js LTS for Next.js apps), plus server-level caching (LiteSpeed, Nginx FastCGI, or Redis).
  • Morocco Law 09-08 (CNDP) considerations: If your platform collects personal data from Moroccan users (lead forms, patient inquiries, orders), hosting servers outside Morocco triggers CNDP cross-border transfer rules that must be factored into your compliance posture.
  • Backups and isolation: Confirm automated daily backups stored off-server, account isolation on shared plans, and staging environment availability before deploying updates.
Hosting architectureBest-fit use caseTechnical strengthsKey limitationsTypical annual range
Shared NVMe via Moroccan registrarLightweight WordPress brochure site, small local businessLocal MAD invoicing, consolidated .ma billing, local supportShared CPU/RAM pools; TTFB can vary under noisy-neighbor load400 – 1,200 MAD / year
Managed LiteSpeed shared hosting (EU + CDN)Corporate WordPress, real estate directory, content-heavy siteHTTP/3, native page caching, fast NVMe storage, automated SSLReview CNDP Law 09-08 cross-border data rules if storing user data outside Morocco900 – 2,500 MAD / year
Managed VPS / Cloud (Nginx + Redis + Node/PHP)WooCommerce with CMI, custom React/Next.js apps, multi-region trafficDedicated compute, tunable Redis/OPcache, isolated staging, consistent TTFBRequires ongoing sysadmin maintenance (OS patches, firewall, uptime alerts)2,400 – 8,000+ MAD / year

4. Essential DNS setup: web routing, SSL, and email deliverability

Keeping domain registration, web hosting, and corporate email decoupled prevents mail outages whenever you upgrade or change web servers. Even for small brochure sites, incomplete DNS records cause certificate warnings or send quote emails straight to spam.

Verify these core records in your DNS zone:

  • A / AAAA and CNAME records: Point the root (@) to your web server IPv4/IPv6 address and configure www consistently with your canonical redirect rule (for example, redirecting apex to https://www.example.ma via 301).
  • MX records: Route email exclusively to your mail host (Google Workspace, Microsoft 365, Zoho Mail, or dedicated mail infrastructure) independently of the web server.
  • SPF, DKIM, and DMARC (TXT records): Authenticate outgoing messages from contact forms, invoices, and WooCommerce order notifications so major inbox providers accept your mail.
  • SSL/TLS coverage: Confirm your TLS certificate covers both the apex domain and www subdomain, with strict HTTP-to-HTTPS 301 enforcement.
  • DNSSEC (where supported): Adds cryptographic validation to DNS lookups when both your .ma registrar and DNS provider support DS records.
Ali Ouarzazi
Engineering tip: avoid unauthenticated PHP mail() on shared hosting
On WordPress or custom PHP sites, avoid raw mail() calls from shared web nodes. Route transactional notifications through authenticated SMTP or an email API aligned with your SPF and DKIM keys for reliable inbox delivery.

5. Technical checklist for migrating a .ma website with zero downtime

Most outages during hosting migrations stem from switching NS nameservers abruptly while DNS TTL values are still high (24–48 hours), or forgetting to copy existing MX records into the new DNS zone.

Following this staged sequence keeps web pages, SSL certificates, and corporate email running uninterrupted during cutover.

  • ✓ 48 hours before cutover: lower the TTL on active A, AAAA, and CNAME records to 300 seconds (5 minutes).
  • ✓ Clone site files and database to the new host and verify every page privately via local hosts-file mapping before public DNS updates.
  • ✓ If changing nameservers, replicate all existing MX, TXT (SPF, DKIM, DMARC, Search Console verification), and subdomain records in full beforehand.
  • ✓ Provision SSL/TLS certificates for both apex and www on the destination server prior to DNS switch.
  • ✓ Point A/CNAME records to the new server IP, verify HTTP status codes (200 on canonical URLs, 301 on HTTP/non-www), and monitor crawl stats in Google Search Console.

Key takeaway

A dependable website in Morocco starts with clear fundamentals: registering your .ma (or .com) domain directly under your own legal entity, picking hosting based on verified TTFB, modern runtimes, and automated backups, and maintaining clean DNS records for both web routing and email authentication. Auditing those pieces before launch or migration prevents most availability and deliverability issues.

Frequently asked questions

How much does a .ma domain name cost per year in Morocco?

Among ANRT-accredited registrars in Morocco, standard annual registration and renewal for a .ma domain typically ranges between 120 and 250 MAD excl. VAT depending on the provider and bundled DNS/support features. Introductory first-year discounts may apply, so always check the ongoing renewal rate.

Can an individual or a foreign company register a .ma domain?

Yes. The standard .ma extension is open to Moroccan individuals and businesses as well as foreign entities through accredited registrars, subject to each registrar’s identity or administrative-contact requirements. Regulated sub-spaces such as .gov.ma or .ac.ma require specific institutional documentation.

Must a website be physically hosted inside Morocco to rank well on Google.co.ma?

No. Google does not require servers to sit physically inside Morocco for local rankings—content relevance, clear domain/URL targeting, and low latency matter far more. A well-tuned Western European server (Paris, Madrid, Frankfurt) with HTTP/3 and caching delivers fast load times across Morocco, though domestic hosting remains important when data-residency rules apply.

How can you avoid email downtime when switching web hosting providers?

Avoid switching NS records abruptly without migrating the complete DNS zone first. The safest approach is to keep your current DNS host—or replicate all MX, SPF, DKIM, and DMARC records identically before cutover—and update only the web-facing A/AAAA or CNAME records after lowering the TTL.

Ali Ouarzazi

Independent web developer based in Marrakech. He helps Moroccan and international businesses deploy WordPress and React platforms, reliable hosting setups, and technical SEO foundations.

✨ Professional services

Services & technical solutions related to this guide

Discover tailored engineering services by Ali Ouarzazi to implement these strategies:

Ready to discuss your web project?

Direct exchange with Ali Ouarzazi. Clear itemized quote.