How can i release & renew my IP address

Asked by passionguy

I often have a need of releasing & renewing my IP address as my router is not providing the IP address in the case of a restart etc,, How would i go abt this thru terminal.

I also need to assign DNS for my new router as it has some DNS issues. I have to assign DNS every time i turn on my computer. How can i save this configuration?

Thanks....

Question information

Language:
Spanish (Argentina) Edit question
Status:
Solved
For:
Ubuntu dhcp3 Edit question
Assignee:
No assignee Edit question
Solved by:
passionguy
Solved:
Last query:
Last reply:
Revision history for this message
Ariel Cabral (acabral1961) said :
#1

Which version of Ubuntu are you using?
The configuration for a static IP is different between 8.04 and 8.10.
In general terms you must disable the roaming mode an configure you network card as static IP.
This is (in 8.04) at system->Administration->Network.

Revision history for this message
passionguy (fayazahmedj) said :
#2

Well i m using Gutsy & i need to assign a static DNS not an static IP.

I dun know whether it is a DNS issue with my router or with my ISP. Is there any way to find out this..

Thanks a lot.

Revision history for this message
Ariel Cabral (acabral1961) said :
#3

There is two ways to solve your problem:
1- Change your router's configuration (Need some info about your router)
2- Change your Network configuration by assigning a static IP with static DNS.
Hope this helps, let me know.

Revision history for this message
passionguy (fayazahmedj) said :
#4

Plz tell me wat kind of info is needed frm the router

Revision history for this message
Ariel Cabral (acabral1961) said :
#5

Hi, brand and model of your router is needed as a start.
Is your router connected to your computer trough Ethernet or USB?

Revision history for this message
passionguy (fayazahmedj) said :
#6

Well it is GrandStream & its model no is HT502. I m sorry if it is not a renowned brand.,

It is connected thru Ethernet.

Revision history for this message
passionguy (fayazahmedj) said :
#7

How can i just assign static DNS alone excluding static IP. And please tell me wat is the command thru terminal for release & renew of an IP address

Thanks.......

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#8

To put your DNS instead of the dns provided by DHCP server... please try this:

This is related to the opendns server but you can use with all dns server you want please simply change the ip of the dns server into rows below.

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo cp /etc/resolv.conf /etc/resolv.conf.auto

gksudo gedit /etc/dhcp3/dhclient.conf

append the following line to the document
prepend domain-name-servers 208.67.222.222,208.67.220.220;

save and exit then type:

sudo ifdown eth0 && sudo ifup eth0

---------------------------------------------------------------------------------------------------

If the above don't work, please try to modify and lock the /etc/resolv.conf

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo gedit /etc/resolv.conf

add this rows as first DNS server (you can also put your provider DNS instead of OpenDNS servers)

nameserver 208.67.222.222
nameserver 208.67.220.220

save and exit

Then to avoid other modification from other program, lock your resolv.conf, still sing terminal type:

sudo chattr +i /etc/resolv.conf

Then try... if still this doesn't works please rebbot your pc, and try again.

--------------------

To renew the lease of ip from a dhcp server

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo dhclient eth0

Hope this helps

Revision history for this message
passionguy (fayazahmedj) said :
#9

This helped me very well.....

Thanks a lot....