View Single Post
Join Date: Nov 2008
Posts: 14
Reputation: EdTheUniqueGeek is an unknown quantity at this point 
Solved Threads: 0
EdTheUniqueGeek EdTheUniqueGeek is offline Offline
Newbie Poster

Re: Change DNS from DHCP to static in Ubuntu

 
0
  #3
Nov 18th, 2008
Originally Posted by eggi View Post
Hey there,

It sounds like you want to change ethernet settings and reset your DNS.

For DNS, the easiest way would be to create an additonal resolv.conf - /etc/resolv.conf.static or something like that - and backup your current resolv.conf and copy that one over it.

For your ethernet address, you should be able to do something close to the following (setting up a file in /etc/network/interfaces would make this easier, but not as easy to explain

Assuming eth0

ifdown eth0
ifconfig eth0 10.10.10.10 netmask 255.255.255.0 up


should do it - just change 10.10.10.10 to your static IP and replace the 255.255.255.0 subnet mask with whatever is appropriate for your system.


Hope that helps

, Mike
Thanks for the reply.
Actually, the only thing I want to change is my DNS IP.
Here's the scenario. I have Ubuntu 8.10 running on my Dell Mini 9 and I take this machine everywhere. At home I have DHCP setup with my router serving OpenDNS as my DNS for all of my client machines on my LAN. When I leave my house, when I go to a wifi hotspot, like Starbucks or whatever, I would like to continue to use OpenDNS IP's as my DNS servers.
So, when I enter the wifi hotspot, I would like to launch a script on my desktop to automatically change my DNS IPs from the IPs that were given to me by that public wifi to the OpenDNS IPs instead.
Is that possible? Should I just create a script to rename that resolve.conf file every time I want to use a static DNS IP?
Thanks in advance.
-----------------------------------
http://www.edwardcrosby.com
http://www.theuniquegeek.com
Reply With Quote