One for the Gods Of Linux :) In need of help (Centos / Redhat)

ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
Hi guys I am having some trouble with getting DNS to work. I will walk you through what I have done so far.

1) Clean Installed Centos
2) Disabled the Network Manager Service
3) Edited /etc/sysconfig/network-scripts/ifcfg-lo (For some reason there isn't a ifcfg-0 or 1 config file?)
4) added the following information

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.168.222
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet

(Restarted the network service) service network restart

5) added the gateway

nano /etc/sysconfig/network

Networking=yes
Hostname= Akira
Gateway= 192.168.1.254

( Restarted network service again)

I can ping the router fine :)

6) Add DNS Details

nano /etc/resolv.conf

nameserver 192.168.1.201

( I also have tried with various other servers such as 8.8.8.8. )

Restart network

Now whenever I try to ping a web address I get Unknown Host. I have read numerous other guides and I am stumped and really need
your help.

Many Thanks
Microsoft's strategy to conquer the I.T industry

" Embrace, evolve, extinguish "

Comments

  • demonfurbiedemonfurbie Member Posts: 1,819
    on the hosts im assuming that you have cleared the dns cashe
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • RoguetadhgRoguetadhg Member Posts: 2,489 ■■■■■■■■□□
    How do you like CentOS? I've heard good things about it.
    In order to succeed, your desire for success should be greater than your fear of failure.
    TE Threads: How to study for the CCENT/CCNA, Introduction to Cisco Exams

  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    3) Edited /etc/sysconfig/network-scripts/ifcfg-lo (For some reason there isn't a ifcfg-0 or 1 config file?)

    You don't configure the ifcfg-lo file - in fact, leave it as is as it is the loopback adapter, here an example
    DEVICE=lo
    IPADDR=127.0.0.1
    NETMASK=255.0.0.0
    NETWORK=127.0.0.0
    # If you're having problems with gated making 127.0.0.0/8 a martian,
    # you can change this to something else (255.255.255.255, for example)
    BROADCAST=127.255.255.255
    ONBOOT=yes
    NAME=loopback
    

    What you need is the file with the same name as your interface.

    So, if your interface is eth0, you go with ifcfg-eth0

    For example
    DEVICE=eth0
    BOOTPROTO=static
    BROADCAST=192.168.168.255
    IPADDR=192.168.168.222
    NETMASK=255.255.255.0
    NETWORK=192.168.168.0
    ONBOOT=yes
    
    My own knowledge base made public: http://open902.com :p
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Thanks I shall give this a go and let you know what happens :)
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • it_consultantit_consultant Member Posts: 1,903
    ally_uk wrote: »
    Hi guys I am having some trouble with getting DNS to work. I will walk you through what I have done so far.

    1) Clean Installed Centos
    2) Disabled the Network Manager Service
    3) Edited /etc/sysconfig/network-scripts/ifcfg-lo (For some reason there isn't a ifcfg-0 or 1 config file?)
    4) added the following information

    DEVICE=eth0
    BOOTPROTO=static
    IPADDR=192.168.168.222
    NETMASK=255.255.255.0
    ONBOOT=yes
    TYPE=Ethernet

    (Restarted the network service) service network restart

    5) added the gateway

    nano /etc/sysconfig/network

    Networking=yes
    Hostname= Akira
    Gateway= 192.168.1.254

    ( Restarted network service again)

    I can ping the router fine :)

    6) Add DNS Details

    nano /etc/resolv.conf

    nameserver 192.168.1.201

    ( I also have tried with various other servers such as 8.8.8.8. )

    Restart network

    Now whenever I try to ping a web address I get Unknown Host. I have read numerous other guides and I am stumped and really need
    your help.

    Many Thanks

    Every time I install the tiny Centos version (you know, the 400 MB one) I have to open my "Linux for Dummies" book to remind me how to configure the darned interface.
  • ChooseLifeChooseLife Member Posts: 941 ■■■■■■■□□□
    ally_uk wrote: »
    whenever I try to ping a web address I get Unknown Host.
    First things first:
    1. ping 192.168.1.201
    2. dig @192.168.1.201 www.google.com[U][/U]
    3. dig www.google.com
    

    What do you get for each of those?
    “You don’t become great by trying to be great. You become great by wanting to do something, and then doing it so hard that you become great in the process.” (c) xkcd #896

    GetCertified4Less
    - discounted vouchers for certs
  • demonfurbiedemonfurbie Member Posts: 1,819
    i gave up the light version of centos and just now use clearos (centos with a web based config)

    if i have to use centos i install every damn thing so i dont have to worry about it later, its alot easier to turn off unneeded things off than install/config later
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • dead_p00ldead_p00l Member Posts: 136
    Roguetadhg wrote: »
    How do you like CentOS? I've heard good things about it.

    It's Redhat without the Redhat. After years of using debian it took a little getting used to but it's not bad at all.
    This is our world now... the world of the electron and the switch, the
    beauty of the baud.
  • dontstopdontstop Member Posts: 579 ■■■■□□□□□□
    Yes, after re-reading. Check that DNS is actually responding to your queries

    Have you tried to ping 8.8.8.8?
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Ok started with a clean install, Disabled network manager

    Performed a ifconfig -a which told me my ethernet adapter is eth-0


    I then went to network-scripts and created a ifcfg-eth0 file

    DEVICE=ETH0
    BOOTPROTO=STATIC
    BROADCAST=192.168.1.255
    IPADDR=192.168.1.205
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    ONBOOT=YES

    Now when I run service network I am being greeted with a Device ETH0 does not seem to be present?

    Now I am really confused
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    unless it is a copy / paste error, make sure it's lowercase (eth0 not ETH0 in the config file).
    My own knowledge base made public: http://open902.com :p
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    All sorted :)

    /etc/sysconfig/network-scripts



    DEVICE=eth0
    BOOTPRO=STATIC
    IPADDR=192.168.1.5
    NETMASK=255.255.255.0
    ONBOOT=YES
    DNS1=192.168.1.1
    DNS2=8.8.8.8

    Can ping router, and other machines and am wiriting this message from Akira which is my Centos Server so now have a Static I.P didn't have to edit resolv.conf though.

    :)
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Got another interesting issue, I have another Centos Box at work I have setup the static I.P address and DNS as above.

    I can ping the gateway fine from the Centos box, I can Ping Google and the dns server by I.P address. When I run dig google.com it produces results and yum-update enabled me to update the system. So DNS is working fine.

    The snag I am now having is I cannot ping another host or I have another host when DHCP was enabled on the Centos box I could ping between both and could access the Centos machine via SSH. Firewall has been configured on the host machine to accept ICMP

    IP details are correct and the gateway is set correct.

    further troubleshooting check route?

    ifcfg-eth0

    DEVICE=eth0
    BootPRO=Static
    IPADDR=192.168.1.255
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.254
    ONBOOT=YES
    DNS1=192.168.1.200
    DNS2=8.8.8.8


    /etc/sysconfig/network

    NETWORKING=yes
    NETWORKING_IPV6=no
    HOSTNAME=AKIRA
    GATEWAY=192.168.1.254

    results of route

    Destination gateway Genmask flags Metric Ref Use Iface
    192.168.1.0 * 255.255.255.0 V 0 0 eth0
    link-local * 255.0.0 V 1002 0 eth0
    default my.router VG 0 eth0
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • demonfurbiedemonfurbie Member Posts: 1,819
    umm ya sure the ip is good ... last i checked .255 was reserved
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Changed I.P address, and temporarily disabled Windows Firewall seems like I have to add allow ICMP echo on the Windows Firewall to allow Ping Requests before could only ping one way from the Windows Host to server any Ping request leaving the Linux side would get blocked by the firewall.

    Issue resolved :) good learning process though
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    ally_uk wrote: »
    good learning process though

    Problems are the best way to learn, that's for sure ;)
    My own knowledge base made public: http://open902.com :p
Sign In or Register to comment.