Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to create a basic Ubuntu 12.04 LAMP server under VBox. Once I have it configured with a base Data set I want to Snapshot that and be able to hand it off to my development partners to use. Basically I want to be able to clone/snapshot a ready to use LAMP server.

I am under the impression I would want to assign a static IP / Hostname and then open port 3306 using iptables. I would then provide this info to anyone using this database server.

To that end I am installing Ubuntu Server 12.04 and LAMP and then following the standard tutorials on setting a static IP. I have etc/network/interfaces configured but when it comes to writing the nameserver entries in resolv.conf, I open it but the first two lines state not to edit that changes will be lost.

here is what I have in /etc/network/interfaces

auto eth0
iface etho inet static
    address 192.168.1.155
    netmask 255.255.255.0   
    network 192.168.1.1
    gateway 50.43.32.1
    broadcast 192.168.1.255
    nameserver 184.16.33.54 184.16.4.22

When I attempt to restart the network I get an error stating:

Reconfiguring network interfaces
RTNETLINK answers: File exists
Failed to bring up eth0
                                                       [OK]

What would I edit to effect the hostname changes and better yet might there be an easier way to accomplish what I am after. I know I can edit my internal network to assign a static IP and I am doing that for a network storage device, but I would rather not rely on that interface to be there for others in this case.

Thanks for any the input and advice in advance.

share|improve this question
    
What do you mean by "effect the hostname changes"? –  jdthood Mar 19 '13 at 9:32
    
Thanks for the info in your answer. etho in my question is a typo. In my /etc/network/interfaces file it is eth0 as I only changed dhcp to static on that line and then added the network addressing, etc. below. I had tried dns-nameserver at one point. I went ahead and made the dns-nameserver change and restarted but got the same error. I will take a better look at your advice against what I have already tried. To answer your question regarding hostname changes. More or less how I bind the servername to the static IP addressing. Thanks for all your help. –  apesa Mar 19 '13 at 14:05
    
Note that the option name is dns-nameservers, not dns-nameserver. –  jdthood Mar 19 '13 at 21:06
add comment

1 Answer 1

up vote 2 down vote accepted
  1. The correct syntax for specifying nameserver addresses in /etc/network/interfaces is

    iface eth0 inet static
        ...
        dns-nameservers 1.1.1.1 2.2.2.2
    
  2. In your /etc/network/interfaces as quoted in your question you have named the interface etho rather than eth0.

  3. You can omit the network option in /etc/network/interfaces. It is no longer needed or used.

After editing /etc/network/interfaces do the following to activate the changes.

    sudo ifdown eth0
    sudo ifup eth0
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.