DEV Community

atymic
atymic

Posted on • Originally published at atymic.dev

2 2

Editing DNS records for ZEIT Now

ZEIT Now is awesome, but one of the features that's missing is a GUI interface to edit and configure DNS records. It's actually
not even clear this is possible in the dashboard, but luckily there's a set of commands you can use with the CLI.

First off, if you haven't already install and authenticated in the now cli, you'll want to do that:

npm install -g now && now # Will prompt to login

Once you're logged in, you can use the commands in the now dns namespace.

Adding Records

now dns add <domain> <name> <record type> <value> [mx_priority]
  • <domain> is the address owned by the user and previously registered withzeit.world by using the commands now domain add zeit.rocks or now alias
  • <name> is the subdomain that will be prefixed to <domain> (@ as a <name> refers to the domain without any prefix)
  • <record type> contains one of the supported record types shown above
  • <value> indicates the target of the record (like an IP address or a hostname)
  • [mx_priority] sets the priority of a certain MX record and can therefore only be used in conjunction with this record type

Examples

Here's a few examples of commands that might be helpful.

Add a record for a subdomain

  $ now dns add <DOMAIN> <SUBDOMAIN> <A | AAAA | ALIAS | CNAME | TXT>  <VALUE>
  $ now dns add zeit.rocks api A 198.51.100.100

Add a MX record (@ as a name refers to the domain)

  $ now dns add <DOMAIN> '@' MX <RECORD VALUE> <PRIORITY>
  $ now dns add domain.com '@' MX mx1.improvmx.com 10 

Add a SRV record

  $ now dns add <DOMAIN> <NAME> SRV <PRIORITY> <WEIGHT> <PORT> <TARGET>
  $ now dns add zeit.rocks '@' SRV 10 0 389 zeit.party

Remove a MX record

  $ now dns ls # Show the records, and copy the ID you wish to remove
$ now dns rm rec_92bd1b1e4311ffd93e4a2cae # ID from previous step




API

If you're building a tool that integrates directly with Zeit Now, you could also manage the DNS records directly through the
API. You can find the endpoint documentation here.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️