DHCP in GENTOO

after i asigned a public IP to my gentoo box and restart my net.eth0 . i found i cannot visit google until i restart my DHCP daemon. why do i need restart my DHCP? since i manully set my public ip . i own IPs such as 44.55.66.1~255
llvllar1onAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
slyongConnect With a Mentor Commented:
Some of the setting of DHCP is that when it gets the IP, it also setup the DNS server.  If you have IP but not DNS setup, you cannot use name like www.google.com but you can still ping the IP address like 66.249.89.104.

That's the reason I asked you to do:

$ ping 66.249.89.104
and see if it works.  If it does, then most probably is your DNS not setup properly.  You need to put the DNS server into /etc/resolv.conf
0
 
nociConnect With a Mentor Software EngineerCommented:
Which dhcp daemon are taking about:

dhcpcd  - client daemon indeed doesn't make sense.....

dhcpd   - dhcp server well..., if you interface changes state the dhcp daemon cannot work because is is bound to interfaces
              Are you using your dhcp server? if not don't start it. If you are using it, your DHCP box should be stable
              (ip wise) ==> this is a onetime event... the problem being that your dhcp server was started before you finished your IP setup.
              The interface binding might also prevent changes from happening to the interface.


0
 
slyongConnect With a Mentor Commented:
After you assigned static IP can you try to ping google's ip like 66.249.89.104??  If you can ping but cannot browse, check your /etc/resolv.conf, it should contain your DNSes.. like:

nameserver 111.222.333.441
nameserver 111.222.333.442
0
 
llvllar1onAuthor Commented:
the command i used for DHCP  is------------ etc/init.d/DHCPD restart---------------
I have no ideal this command is for client or sever.

how is /etc/resolv.conf work?   when i open this file in my SUSE box (no the one i mentioned Gentoo), I found it is blank.

0
 
nociConnect With a Mentor Software EngineerCommented:
Ok this is the dhcp server, it opens a private port on an interface and thus lock a route to the local network...

After reloading the dhcp server it reopens the network port .... that might release some other locks...

man 5 resolv.conf gives you the whole story.

In short:

domain example.com    
nameserver i.p.a.dr

the domain line tell what YOUR domain is i.e. xyz realy means lookup xyz.example.com
the nameserver line tells the resolver (name => address translator of glibc)
which DNS server knows how to translate names.  i.e .fill in your own DNS server's address
or fill in the ones from your provider.

you can use multiple nameserver lines...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.