User Tools

Site Tools


build:ips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
build:ips [2005/11/05 08:40]
10.42.69.101 Created to document IP and domain name changes (CMB)
build:ips [2009/08/05 18:10] (current)
64.241.37.140
Line 1: Line 1:
 ====== How to Change IP Address and/or Host Name ====== ====== How to Change IP Address and/or Host Name ======
  
-This page describes the steps required to change IP addresses and/or domain names. It should be used whenever changing ISPs, or whenever the IP address or domain/​system name of the system changes.+This page describes the steps required to change IP addresses and/or domain names. It should be used whenever changing ISPs, or whenever the IP address or domain/​system name of system changes.
  
 Note that this page may get out of sync with the other pages. But the hope is that everything is documented here. Either way, be sure to test all network applications after changing the system'​s IP address and/or host name. Note that this page may get out of sync with the other pages. But the hope is that everything is documented here. Either way, be sure to test all network applications after changing the system'​s IP address and/or host name.
Line 7: Line 7:
 ===== System ===== ===== System =====
  
-The IP address is stored in /​etc/​network/​interfaces on Debian systems. You can its settings by taking ​the interface down and bringing ​it back up. If you're connected via the network, you'll get logged out. You'll probably be able to log back in over the network, but be prepared to log in at the console if things go wrong.+The IP address is stored in ''​/​etc/​network/​interfaces'' ​on Debian systems. You can take the interface down and bring it back up to change the IP address (''​ifdown eth0 && ifup eth0''​). If you're connected via the network, you'll get logged out. You'll probably be able to log back in over the network, but be prepared to log in at the console if things go wrong.
  
-The host name and domain name are configured a bit oddly in Debian. The hostname is set in /​etc/​hostname. You should probably use the hostname command to set it. The domain name is determined by looking up the system'​s IP address in the /etc/hosts file. Hence, the first entry for the IP address must be the fully qualified name of the system. The host name (without the domain name) should come after the FQDN.+The host name and domain name are configured a bit oddly in Debian. The hostname is set in ''​/​etc/​hostname''​. You should probably use the hostname command to set it. The domain name is determined by looking up the system'​s IP address in the ''​/etc/hosts'' ​file. Hence, the first entry for the IP address must be the fully qualified name of the system. The host name (without the domain name) should come after the FQDN.
  
-You should also make sure /etc/hosts is updated for any other systems that are getting their IP address or name changed.+You should also make sure ''​/etc/hosts'' ​is updated for any other systems that are getting their IP address or name changed.
  
 To verify the IP address, run: To verify the IP address, run:
-  $ /​sbin/​ifconfig | grep -E '​(^[a-z])|inet addr'+<code bash> 
 +/​sbin/​ifconfig | grep -E '​(^[a-z])|inet addr' 
 +</​code>​
  
-To verfy the host name, domain name, and FQDN, run: +To verify ​the host name, domain name, and FQDN, run: 
-  ​$ ​hostname +<code bash> 
-  ​$ ​hostname -d +hostname 
-  ​$ ​hostname -f+hostname -d 
 +hostname -f 
 +</​code>​ 
 + 
 +On Solaris, changing a hostname/IP is a bit different. The hostname of the system is contained in /​etc/​hostname.<​interface>​. If your primary interface is hme0, your hostname (not FQDN) would be in /​etc/​hostname.hme0. That hostname also needs to needs to be in /​etc/​inet/​ipnodes. Solaris finds the corresponding IP in those files and then assigns it to the appropriate interface. Once you've changed the config files, you can either run '​svcadm -v refresh network/​physical'​ or reboot. 
 + 
 +Note that if your network does not use the default netmask for its class, you will need to enter the network address and netmask in /​etc/​netmasks.  
 + 
 +Solaris sets the default router in /​etc/​defaultrouter.
  
 ===== Firewall ===== ===== Firewall =====
Line 35: Line 45:
 ===== DNS ===== ===== DNS =====
  
-Our caching DNS server is configured to query the upstream DNS server for anything it doesn'​t have cached. This will generally be the ISP's DNS server. This will need to be changed when changing ISPs, as the ISPs generally only allow their own customers to access their DNS servers. The setting is stored in the /​var/​lib/​named/​etc/​bind/​named.conf.options file, in the forwarders statement.+Our caching DNS server is configured to query the upstream DNS server for anything it doesn'​t have cached. This will generally be the ISP's DNS server. This will need to be changed when changing ISPs, as the ISPs generally only allow their own customers to access their DNS servers. The setting is stored in the ''​/​var/​lib/​named/​etc/​bind/​named.conf.options'' ​file, in the ''​forwarders'' ​statement. 
 + 
 +When changing domain names, the ''/​etc/​resolv.conf''​ file needs to have the ''​domain''​ setting changed. 
 + 
 +===== Authoratative DNS Records =====
  
-When changing ​domain names, the /etc/resolv.conf file needs to have the domain setting changed.+When changing ​system IPsyou'll need to update ​the authoratative DNS records for those systemsThese are hosted at EveryDNS. See the [[domains]] page for more info.
  
 ===== NTP ===== ===== NTP =====
Line 46: Line 60:
  
 Postfix needs to know our domain name in order to receive email for that domain. It's also nice to have it receive mail for its own host name. To change domain names, change the following configuration settings: Postfix needs to know our domain name in order to receive email for that domain. It's also nice to have it receive mail for its own host name. To change domain names, change the following configuration settings:
-  ​postconf -e "​myhostname=`hostname -f`" +<code rootshell>​ 
-  postconf -e "​mydomain=`hostname -d`"+postconf -e "​myhostname=`hostname -f`" 
 +postconf -e "​mydomain=`hostname -d`" 
 +</​code>​
  
-It may be necessary to change the mynetworks setting, if you're changing the IP address of any systems that need to be able to send outbound email through this system.+It may be necessary to change the ''​mynetworks'' ​setting, if you're changing the IP address of any systems that need to be able to send outbound email through this system.
  
 Restart Postfix to make the settings take affect: Restart Postfix to make the settings take affect:
-  ​/​etc/​init.d/​postfix restart+<code rootshell>​ 
 +/​etc/​init.d/​postfix restart 
 +</​code>​
  
 ===== Apache ===== ===== Apache =====
Line 58: Line 76:
 Our Apache virtual hosts are set to listen on all interfaces, so no changes need to be made when changing IP addresses. Our Apache virtual hosts are set to listen on all interfaces, so no changes need to be made when changing IP addresses.
  
-We used named virtual hosts, so any changes in domain names will need to be updated in the Apache virtual host configuration files. ​Change any ServerName and ServerAlias settings in the files in /​etc/​apache2/​sites-available ​and /​etc/​apache2/​sites-enabled/.+We used named virtual hosts, so any changes in domain names will need to be updated in the Apache virtual host configuration files. ​Check all the ''​ServerName'' ​and ''​ServerAlias'' ​settings in the files in ''​/​etc/​apache2/​sites-available/​''​.
  
 ===== IMAP ===== ===== IMAP =====
  
-I don't think there are any changes that are required in the IMAP server when chaging ​IP address or system name.+I don't think there are any changes that are required in the IMAP server when changing ​IP address or system name.
  
 ===== LDAP ===== ===== LDAP =====
  
 LDAP is not implemented on our systems yet. LDAP is not implemented on our systems yet.
build/ips.1131201620.txt.gz · Last modified: 2006/01/16 18:34 (external edit)