Q. How do I Change the IP Address of a Domain or Host under BIND 8 or 9?
A. You can easily change the IP address of a Domain or host under BIND dns software. You need to update zone database. Usually, named.conf file contains the location for zone file for each domain. You need to open this file using a text editor such as vi and update the domain / HOST IP including serial number. You need to only make changes on master BIND DNS server.
Follow the steps below if you want to change IP address of a domain / host. Open named.conf on master dns server, enter:
# vi named.conf
Find domain name. For example, entry for theos.in, look like as follows:
zone "theos.in" {
type master;
file "/etc/bind/zones/master.theos.in";
allow-transfer { key TRANSFER; };
};Open zone database file called /etc/bind/zones/master.theos.in, enter:
# vi /etc/bind/zones/master.theos.in
Find A (IP Adress) dns recored for domain called theos.in, which may look like as follows:
@ 3600 IN A 75.126.168.153 www 3600 IN A 75.126.168.153
Update it as follows to change IP from 75.126.168.153 to 64.12.54.5, enter:
@ 3600 IN A 64.12.54.5 www 3600 IN A 64.12.54.5
Find serial number, which may look like as follows:
2007071012
And update it:
2007071013
Here is zone before any changes:
$ORIGIN theos.in.
$TTL 3h
@ IN SOA ns1.nixcraft.net. vivek.nixcraft.com. (
2007071012 ; Serial yyyymmddnn
3h ; Refresh After 3 hours
1h ; Retry Retry after 1 hour
1w ; Expire after 1 week
1h) ; Minimum negative caching of 1 hour
@ 3600 IN NS ns1.nixcraft.net.
@ 3600 IN NS ns2.nixcraft.net.
@ 3600 IN TXT "v=spf1 mx ~all"
@ 3600 IN A 75.126.168.153
www 3600 IN A 75.126.168.153Here is zone after the IP Address change:
$ORIGIN theos.in.
$TTL 3h
@ IN SOA ns1.nixcraft.net. vivek.nixcraft.com. (
2007071013 ; Serial yyyymmddnn
3h ; Refresh After 3 hours
1h ; Retry Retry after 1 hour
1w ; Expire after 1 week
1h) ; Minimum negative caching of 1 hour
@ 3600 IN NS ns1.nixcraft.net.
@ 3600 IN NS ns2.nixcraft.net.
@ 3600 IN TXT "v=spf1 mx ~all"
@ 3600 IN A 64.12.54.5
www 3600 IN A 64.12.54.5Save and close the file. Reload bind:
# rndc reload
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 1 comment… read it below or add one }
I have tried to write a response here and each time I try it refreshes the screen or provides an error. Can the writer could possibly look into the reason it keeps messing up?