How To

Updating an A record from Command Line

Written by SXI ADMIN · 1 min read >

Domain Name Service, or DNS, can be one of the most be one of the more complicated concepts in server administration. This article will walk through changing an A record from the Linux command line.
This article assumes that you are running BIND on a linux server, that you already have an understanding of what DNS is, the different types of DNS entries, and how DNS works. Please note: The incorrect editing of your zone file can take your site offline. All editing must be done on the authoritative nameservers for the given domain.

Before updating any DNS record, you will want to lower the Time to Live (TTL) values for that zone file. A guide to dropping the TTL values can be found here.

Below is an example of what the zone file looks like from the command line.

; Zone file for
$TTL 14400
@ 86400 IN SOA (
2010090802 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds 86400 IN NS 86400 IN NS IN A IN A IN MX 0
ftp IN A
cpanel IN A

When editing an A record, we are concerned with any of the lines that something ‘IN A IP-address’. You may want to change an A record because the IP of a subdomain has changed for whatever reason. Due to propagation times involved with making DNS changes, you will want to make sure that you only make changes if they are absolutely needed.

The steps to change the A record are rather straightforward. In this example, we will change the IP address of the subdomain. To make these changes from the command line:

  1. Edit the zone file with your favorite command line editor. In this example, we use ‘vi’.

[[email protected] /var/named/]% vi /var/named/

  1. Locate the appropriate line and update the up address. You will see something like the following:

ftp IN A

  1. Update the Zone’s Serial number.
  2. Make BIND aware of your DNS changes by reloading the DNS zone.

[[email protected] /var/named/]% rndc reload

  1. Test that your changes worked correctly using ‘dig’.

[[email protected] /var/named/]% dig @localhost

That is all you have to do to change an A record on the command line. If you are uncomfortable with the command line, you can also update your A records using Web Host Manager.

If you have any questions or are not comfortable making these changes yourself, please feel free to contact Heroic Support.

=== Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
[email protected]

How to Install RabbitMQ on CentOS 7

  ·   1 min read