0844 244 8080

How to Set or Change the IP Address & DNS Settings on a Ubuntu Server

by Paul Freeman-Powell

Share |

Many newcomers to the Linux platform find the command-line interface (CLI) a little daunting at first, but with a little bit of research and an ounce of Mr. Common Sense's inspiration, it's not that hard to learn the basics.

In this article I'll be discussing the common task of changing the IP address and DNS settings on your server. Most of the time you'll want to use a static IP for your server and it's best to do this during installation, but if you need to move your server to a different location or change its IP settings for any other reason, here are the simple steps.

1. Open up the Network Interfaces file

To open the file using the vi text editor, type sudo vi /etc/network/interfaces and press ENTER. You'll then be prompted for your admin password. Enter this, and then vi will open up with your current IP settings. It might look something like this:

auto eth0
iface eth0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
 
In order to make changes to this file you need to enter one of the text-editing modes. Using the arrow keys, move the cursor to where you want it and then either press x to delete text at the current point, or i to enter insertion mode. That will let you edit the file like a normal text file.
 
Once you're finished, press the Esc key to exit whichever mode you're in, and then type :wq! to save and exit the file, then press ENTER.

2. Change DNS Settings

Your DNS settings are located in the resolv.conf file - to edit this, type sudo vi /etc/resolv.conf
 
Edit the file in the same way you edited the network interfaces file.

3. Restart Networking for Changes to Take Effect

To restart the networking services, run this command: sudo /etc/init.d/networking restart
 
Depending on other settings on your network and its infrastructure, you may be able to ping an address such as bbc.co.uk or simply ping your gateway to test the connection. If not, you could always try running sudo apt-get update to test your connection.


Share |
Paul Freeman-Powell

Paul Freeman-Powell is a technology, software and hardware enthusiast. He founded and owns caeus.com Ltd. and works as a web developer, IT consultant and computer repair technician. In his spare time, he speaks French and Spanish fluently and is also a keen drummer and photographer (but not at the same time). His personal web site can be found at www.paulfp.net.

 

Your Comments

CAPTCHA Authorisation Code

Comments are publicly viewable so please don't include any personal data such as your phone number or email address. Submitting a comment indicates acceptance of our Terms & Conditions.

1. At 07:34 on 8 Mar 2012 Berlynn wrote:

Kevin was very special to Elaine and me from the first sesshin we attended 6 or 7 years ago to the most recent a few weeks ago, when he came in during an evening sitting walking slowly with his cane and friends in support. I'll miss his humor and his dedication.

2. At 06:59 on 2 Apr 2012 essay help wrote:

If you have time please explore my brand new website and tell me what you think.

3. At 05:41 on 3 Apr 2012 copywriting wrote:

i like your awesome information after a long time.

4. At 06:55 on 13 Apr 2012 essay writers wrote:

i was lookin for a good information

5. At 13:25 on 13 Apr 2012 UK Dissertation Help wrote:

I am glad to catch idea from your article.

6. At 13:26 on 13 Apr 2012 Need To Buy Essay wrote:

This is really my very first time here, great looking blog.

7. At 13:29 on 13 Apr 2012 How To Write Essay wrote:

This was one of the most well documented blog entries I have read in a long time. It was a pleasure to fill all the gaps I had about this topic. Well written an concise.

8. At 13:29 on 13 Apr 2012 Dissertation Writing Services wrote:

Great site and a great topic as well i really get amazed to read this thanks.

9. At 05:36 on 14 Apr 2012 seo wrote:

Your site bring us an amazing amount of interesting information, which can de useful also by the way.

10. At 14:18 on 16 Apr 2012 dissertation assistance wrote:

I am absolutely blown away at how great the Information is on this site. I have bookmark this site and I intend "Truly that I will visiting the site in The Next Few Days. Great Job keep Up the great work continue.

11. At 14:22 on 16 Apr 2012 quality UK dissertation wrote:

I Enjoyed reading your beautiful article. It seems very useful and informative for us. Keep posting more wonderful thoughts.

12. At 14:23 on 16 Apr 2012 quality seo services birmingham wrote:

You have shared lot of informative material around this subject on the net and this data are definitely better than others.

13. At 14:26 on 16 Apr 2012 MBA dissertation online wrote:

Your article definitely worth looking through.. I must personally appreciate the time you devote to create this marvelous post. I can't wait for new updates on your site.

14. At 14:29 on 16 Apr 2012 buy dissertation online wrote:

Sounds good. This is a useful and informative article. Thanks for sharing this info along with us.

15. At 10:19 on 2 May 2012 essay writing help wrote:

Its really very best and useful site for all,I am using it from a long time,I really got many information from this site.

16. At 10:20 on 2 May 2012 cheap custom essays wrote:

The topic that your blog deals with demands loads of research.This kind of blog always useful for blog readers,

17. At 13:15 on 14 May 2012 Custom Logo Design wrote:

One of my relative suggested me to go through your profile and it become worthwhile for me. I trusted you guys and you provided me with the best result. In the future will commence several of projects with you guys and I am sure that you will fulfill our all requirements.

18. At 13:16 on 14 May 2012 Cheap Logo Design wrote:

I never trusted in outsourcing… but now my perception has changed. I have just break the ice by involving you guys in work as contingent partner and now I am rejoicing the profits and prospering into my own domain… Adieus!

19. At 05:46 on 19 May 2012 hr research paper wrote:

This is a Professional blog,great you can write so beautiful.

Copyright © caeus.com Ltd. 2011. This article and all its contents are the property of caeus.com Limited and are protected by copyright. You may not distribute, modify, transmit, reuse, repost, or use the content of this article for public or commercial purposes (including text and images) without written permission from caeus.com Limited. The views expressed in this article and sites linked to herein are solely those of the author or individual(s) providing them and do not reflect the opinions of caeus.com Ltd., its parents, affiliates or subsidies. Any trademarks and brands mentioned in this article are the property of their respective owners and their use does not imply any affiliation with, or endorsement by, caeus.com Limited. The content of this article is provided in good faith and for information purposes only; you follow any advice given entirely at your own risk and no responsibility can be taken for any consequences which may arise as a result of following advice given in this article.

Articles & How-To Guides


Sign up to caeus.com
Protect Against Identity Theft & Online Fraud... click here

 

Connect With Us:

Valid CSS! Valid XHTML 1.1!