[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cannot resolve hostname



On 07/05/11 14:50, Camaleón wrote:
On Sat, 07 May 2011 14:14:39 +0100, AG wrote:

In what seems to be a string of related issues having to do with
networking, I now find that not only has my IP address been changed from
192.168.1.40 to 192.168.1.64 but also that my machine's name (valhalla)
cannot be resolved.

This is the output of ifconfig:
$ sudo ifconfig
sudo: unable to resolve host valhalla
(...)

:-)

First, resolve your network layout by either using a dynamic setup (your
IP address could change on every reboot) or by using a static
configuration.

http://wiki.debian.org/NetworkConfiguration

Then, review your "/etc/hosts" file.

Do you see the same error if you run "/sbin/ifconfig", that is, using not
"sudo" at all?

Greetings,

Hiya

OK - I want to use a static IP address (easier for a simpleton like me to configure the printer client machine to see it). The IP address I have customarily used is 192.168.1.40 and that is what is in my /etc/hosts file:

127.0.0.1 localhost
192.168.1.40 valhalla.org

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

(I don't know what all the IPv6 references are, but I assume that I can safely ignore those).

When I run /sbin/ifconfig then I don't get the error message about unable to resolve hostname, but I do get that my IP address is now 192.168.1.64

Personally I don't care if the IP address is *.40 or *.64, but I do want it to stay static and I do want to be able to access the Net when I reboot.

So, I have just done the following:

(1) I altered the /etc/hosts IP address to *.64
(2) ensured that the /etc/network/interface file read "static" rather than dhcp
(3) rebooted

When the machine came back on, I was (yet again) unable to access the Net and the only way that I was able to do so was to use Brian's fix #dhclient eth0 which, when checking the /sbin/ifconfig output again shows that the IP address has been made *.64

The hostname is still unresolvable and it seems that I am destined to have to use dhcp when I really don't want to do so ... and yet if I don't I am stuck not being connected. This is rapidly spiralling into a farce and I am still no further ahead than I was, except that I have a partial fix to implement everytime I reboot and hope that the client can find the printer server IP address okay.

Perhaps I am being really thick about all of this, but I am very confused about why - in all of the times I have used and installed Debian - this has just started to occur.

I am really grateful of any clear ideas or strategies about how to fix this.

Thanks

AG


Reply to: