Find the answer to your Linux question:
Results 1 to 5 of 5
hey! im runnig centos 5.1 on vmware and configured eth0 to use dhcp. at this situation, after i added a route line to my router details i can access the ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    1

    have problems with static ip and dns name

    hey!
    im runnig centos 5.1 on vmware and configured eth0 to use dhcp.
    at this situation, after i added a route line to my router details i can access the internet from the server.
    BUT, when i changed to configurations and edited the ip to static one, no matter the gateway stay the same one - suddenly the internet was blocked!

    anyone can help me figure it out?


    i have another problem with the connection to the server:
    i can access the server with my win 7 by the ip address but not by the hostname...

    any help will appreciate

  2. #2
    Just Joined! its_really_me's Avatar
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    24
    TalmoR,

    hi, let me understand...

    eth0 is using DHCP. You connected the network, get an IP address from the router and you can access the Internet, right.
    Now you change to static IP on the machine and no luck anymore.

    Two hints:
    a) you have not set a DNS server and so attempts to the Internet using names (like google ..) do not get resolved. --> add the DNS server name, so maybe the router or whatever the router has assigned before. check while on DHCP with "system-config-network" and go to DNS tab.
    b) you have not set the default router, either within the "system-config-network" tool or via "ip route" command. Configure the default router for example like

    Code:
    ip route add default via [router-ip]
    for example
    Code:
     ip route add default via 192.168.1.254

  3. #3
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    Both problems may be a dns issue. When you changed to
    a static address, you must also specify the name server
    by editing the etc/resolv.conf file.

    i can access the server with my win 7 by the ip address but not by the hostname...
    On second thought, this is a client issue. The easiest way
    to fix it is to edit the hosts file on the Windows computer.
    It is usually in C:\windows\system32\drivers\etc
    There you find (by default) hosts.sam
    Edit it and remove the .sam extension.
    Last edited by rcgreen; 04-20-2010 at 10:25 AM.

  4. #4
    Linux Newbie previso's Avatar
    Join Date
    Jan 2010
    Location
    SC
    Posts
    115
    Google public DNS servers are: 8.8.8.8 and 8.8.4.4
    Gateway is your router IP (ex 192.168.1.1 or 192.168.2.1 depending on brand)

  5. #5
    Just Joined!
    Join Date
    Apr 2010
    Posts
    1
    make sure the the static ip you have assigned and the gateway belong to the same class .
    check the subnet mask
    see if you can ping the router successfully


    second one :

    this is a DNS server problem
    if it dns client: check /etc/resolv.conf
    make sure the the dns server that you have set up is working fine
    and you have resolved the win & system correctly

    if problem still persists feel free to reply

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...