Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #156860 > unrolled thread
| Started by | rlharris@oplink.net |
|---|---|
| First post | 2015-08-27 09:10 +0200 |
| Last post | 2015-08-30 05:10 +0200 |
| Articles | 20 on this page of 24 — 11 participants |
Back to article view | Back to linux.debian.user
what is the static ip address I assigned to eth0? rlharris@oplink.net - 2015-08-27 09:10 +0200
[solved] Re: what is the static ip address I assigned to eth0? rlharris@oplink.net - 2015-08-27 09:30 +0200
Re: [solved] Re: what is the static ip address I assigned to eth0? Jörg-Volker Peetz <jvpeetz@web.de> - 2015-08-27 12:50 +0200
Re: what is the static ip address I assigned to eth0? Gene Heskett <gheskett@wdtv.com> - 2015-08-27 10:30 +0200
Re: what is the static ip address I assigned to eth0? Renaud (Ron) OLGIATI <renaud@olgiati-in-paraguay.org> - 2015-08-27 12:10 +0200
Re: what is the static ip address I assigned to eth0? Hans <hans.ullrich@loop.de> - 2015-08-27 12:30 +0200
Re: what is the static ip address I assigned to eth0? David Wright <deblis@lionunicorn.co.uk> - 2015-08-27 20:40 +0200
Re: what is the static ip address I assigned to eth0? "Thomas Schmitt" <scdbackup@gmx.net> - 2015-08-27 12:30 +0200
Re: what is the static ip address I assigned to eth0? Gene Heskett <gheskett@wdtv.com> - 2015-08-27 18:10 +0200
Re: what is the static ip address I assigned to eth0? Elimar Riesebieter <riesebie@lxtec.de> - 2015-08-27 12:00 +0200
Re: what is the static ip address I assigned to eth0? David Wright <deblis@lionunicorn.co.uk> - 2015-08-27 20:40 +0200
Re: what is the static ip address I assigned to eth0? Elimar Riesebieter <riesebie@lxtec.de> - 2015-08-28 01:00 +0200
Re: what is the static ip address I assigned to eth0? David Wright <deblis@lionunicorn.co.uk> - 2015-08-28 06:40 +0200
Re: what is the static ip address I assigned to eth0? Curt <curty@free.fr> - 2015-08-28 12:10 +0200
Re: what is the static ip address I assigned to eth0? Brian <ad44@cityscape.co.uk> - 2015-08-28 13:10 +0200
Re: what is the static ip address I assigned to eth0? Reco <recoverym4n@gmail.com> - 2015-08-28 13:50 +0200
Re: what is the static ip address I assigned to eth0? Brian <ad44@cityscape.co.uk> - 2015-08-28 15:40 +0200
Re: what is the static ip address I assigned to eth0? Reco <recoverym4n@gmail.com> - 2015-08-28 16:10 +0200
Re: what is the static ip address I assigned to eth0? Brian <ad44@cityscape.co.uk> - 2015-08-28 16:50 +0200
Re: what is the static ip address I assigned to eth0? Curt <curty@free.fr> - 2015-08-28 18:20 +0200
Re: what is the static ip address I assigned to eth0? Brian <ad44@cityscape.co.uk> - 2015-08-28 18:40 +0200
Re: what is the static ip address I assigned to eth0? David Wright <deblis@lionunicorn.co.uk> - 2015-08-31 02:10 +0200
Re: what is the static ip address I assigned to eth0? Reco <recoverym4n@gmail.com> - 2015-08-31 09:00 +0200
Re: what is the static ip address I assigned to eth0? David Wright <deblis@lionunicorn.co.uk> - 2015-08-30 05:10 +0200
Page 1 of 2 [1] 2 Next page →
| From | rlharris@oplink.net |
|---|---|
| Date | 2015-08-27 09:10 +0200 |
| Subject | what is the static ip address I assigned to eth0? |
| Message-ID | <q1ZtT-5E6-7@gated-at.bofh.it> |
Months ago I installed Jessie + xfce on a laptop and assigned a static ip address to eth0. Now I have forgotten the ip address and need to know it before I plug it into my local network. The address is not in /etc/hosts, and there is no Network Manager Applet in the panel. How can I determine the address without reinstalling? rlh
[toc] | [next] | [standalone]
| From | rlharris@oplink.net |
|---|---|
| Date | 2015-08-27 09:30 +0200 |
| Subject | [solved] Re: what is the static ip address I assigned to eth0? |
| Message-ID | <q1ZNf-60L-5@gated-at.bofh.it> |
| In reply to | #156860 |
On Thu, August 27, 2015 2:09 am, rlharris@oplink.net wrote: > Months ago I installed Jessie + xfce on a laptop and assigned a static ip > address to eth0. Now I have forgotten the ip address and need to know > it before I plug it into my local network. > > The address is not in /etc/hosts, and there is no Network Manager Applet > in the panel. > > How can I determine the address without reinstalling? The solution: ifconfig (And it appears that I did not assign a static address, but was using DHCP.) RLH
[toc] | [prev] | [next] | [standalone]
| From | Jörg-Volker Peetz <jvpeetz@web.de> |
|---|---|
| Date | 2015-08-27 12:50 +0200 |
| Subject | Re: [solved] Re: what is the static ip address I assigned to eth0? |
| Message-ID | <q22UN-21M-19@gated-at.bofh.it> |
| In reply to | #156862 |
Have a look at https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_iproute2_commands as well as the whole chapter 5 of the Debian manual. The "modern" way to control the IP-address is $ ip addr -- Regards, jvp.
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@wdtv.com> |
|---|---|
| Date | 2015-08-27 10:30 +0200 |
| Message-ID | <q20Jj-7q5-13@gated-at.bofh.it> |
| In reply to | #156860 |
On Thursday 27 August 2015 03:09:32 rlharris@oplink.net wrote: > Months ago I installed Jessie + xfce on a laptop and assigned a static > ip address to eth0. Now I have forgotten the ip address and need to > know it before I plug it into my local network. > > The address is not in /etc/hosts, and there is no Network Manager > Applet in the panel. > > How can I determine the address without reinstalling? > > rlh Try reading "cat /etc/network/interfaces". Its a text file. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [next] | [standalone]
| From | Renaud (Ron) OLGIATI <renaud@olgiati-in-paraguay.org> |
|---|---|
| Date | 2015-08-27 12:10 +0200 |
| Message-ID | <q22i6-1iz-21@gated-at.bofh.it> |
| In reply to | #156866 |
On Thu, 27 Aug 2015 04:22:11 -0400
Gene Heskett <gheskett@wdtv.com> wrote:
> > Months ago I installed Jessie + xfce on a laptop and assigned a static
> > ip address to eth0. Now I have forgotten the ip address and need to
> > know it before I plug it into my local network.
> > The address is not in /etc/hosts, and there is no Network Manager
> > Applet in the panel.
> > How can I determine the address without reinstalling?
> Try reading "cat /etc/network/interfaces". Its a text file.
Or, as root, run
# ifconfig
Cheers,
Ron.
--
A man will give up almost anything except his suffering.
-- John Cleese
-- http://www.olgiati-in-paraguay.org --
[toc] | [prev] | [next] | [standalone]
| From | Hans <hans.ullrich@loop.de> |
|---|---|
| Date | 2015-08-27 12:30 +0200 |
| Message-ID | <q22Br-1Fk-3@gated-at.bofh.it> |
| In reply to | #156873 |
Am Donnerstag, 27. August 2015, 12:19:23 schrieb Thomas Schmitt: Hi, I understood the question of the op in that way, that he wants to give a new ip-address without installing new. The answer: You can edit /etc/network/interfaces , after this do /etc/init.d/networking restart. If you are using wicd, just edit the config to your needs, it takes your settings before the systems one. Also you might use network-manager, where you can also edit the settings. My preferred combination is a combination of /etc/network/interfaces and wicd. I tried network-manager, too, but it is IMO not as comfortable as wicd. Good luck! Hans
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2015-08-27 20:40 +0200 |
| Message-ID | <q2afE-4d2-19@gated-at.bofh.it> |
| In reply to | #156874 |
Quoting Hans (hans.ullrich@loop.de): > Am Donnerstag, 27. August 2015, 12:19:23 schrieb Thomas Schmitt: > Hi, > I understood the question of the op in that way, that he wants to give a new > ip-address without installing new. > > The answer: > > You can edit /etc/network/interfaces , after this > do /etc/init.d/networking restart. > > If you are using wicd, just edit the config to your needs, it takes your > settings before the systems one. > > Also you might use network-manager, where you can also edit the settings. > > My preferred combination is a combination of /etc/network/interfaces and wicd. > I tried network-manager, too, but it is IMO not as comfortable as wicd. What do you have/need in /etc/network/interfaces except for # The loopback network interface auto lo iface lo inet loopback I was under the impression that wicd wouldn't manage interfaces listed in /etc/network/interfaces Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | "Thomas Schmitt" <scdbackup@gmx.net> |
|---|---|
| Date | 2015-08-27 12:30 +0200 |
| Message-ID | <q22Br-1Fk-5@gated-at.bofh.it> |
| In reply to | #156873 |
Hi, rlharris@oplink.net wrote: > > The solution: ifconfig Renaud (Ron) OLGIATI wrote: > Or, as root, run Or as normal user: /sbin/ifconfig It's only a matter of shell PATH, not of permissions. -------------------------------------------------------- Now why does my eth0 have so many inet6 addr assigned ? 20 pieces of form inet6 addr: 2003:.../64 Scope:Global One of form inet6 addr: fe80:.../64 Scope:Link I am not the only one to wonder. It's a privacy feature http://superuser.com/questions/490138/why-do-i-have-so-many-ipv6-inet6-addresses Have a nice day :) Thomas
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@wdtv.com> |
|---|---|
| Date | 2015-08-27 18:10 +0200 |
| Message-ID | <q27Uu-Xd-11@gated-at.bofh.it> |
| In reply to | #156873 |
On Thursday 27 August 2015 06:02:13 Renaud OLGIATI wrote: > On Thu, 27 Aug 2015 04:22:11 -0400 > > Gene Heskett <gheskett@wdtv.com> wrote: > > > Months ago I installed Jessie + xfce on a laptop and assigned a > > > static ip address to eth0. Now I have forgotten the ip address > > > and need to know it before I plug it into my local network. > > > > > > The address is not in /etc/hosts, and there is no Network Manager > > > Applet in the panel. > > > > > > How can I determine the address without reinstalling? > > > > Try reading "cat /etc/network/interfaces". Its a text file. > > Or, as root, run > > # ifconfig > Which only works if the interface is up and running. The OP was looking for a way to tell the IPV* address before it was running. And if that spec in interfaces is not qualified by the word static, its using dhcp and will not be in that file. OTOH if he is using dhcp, and there is a dhcpd running on HIS network, then its a who cares, it just works. As I believe the OP found out later. > Cheers, > > Ron. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [next] | [standalone]
| From | Elimar Riesebieter <riesebie@lxtec.de> |
|---|---|
| Date | 2015-08-27 12:00 +0200 |
| Message-ID | <q228q-RU-5@gated-at.bofh.it> |
| In reply to | #156860 |
* rlharris@oplink.net <rlharris@oplink.net> [2015-08-27 02:09 -0500]:
[...]
>
> How can I determine the address without reinstalling?
$ host $(hostname)
Elimar
--
.~.
/V\ L I N U X
/( )\ >Phear the Penguin<
^^-^^
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2015-08-27 20:40 +0200 |
| Message-ID | <q2afE-4d2-37@gated-at.bofh.it> |
| In reply to | #156871 |
Quoting Elimar Riesebieter (riesebie@lxtec.de): > * rlharris@oplink.net <rlharris@oplink.net> [2015-08-27 02:09 -0500]: > > [...] > > > > How can I determine the address without reinstalling? > > $ host $(hostname) $ host junk Host junk not found: 3(NXDOMAIN) $ ... whether junk is localhost, another PC on the LAN, or indeed "junk". Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Elimar Riesebieter <riesebie@lxtec.de> |
|---|---|
| Date | 2015-08-28 01:00 +0200 |
| Message-ID | <q2ejf-1y1-7@gated-at.bofh.it> |
| In reply to | #156910 |
* David Wright <deblis@lionunicorn.co.uk> [2015-08-27 13:29 -0500]: > Quoting Elimar Riesebieter (riesebie@lxtec.de): > > * rlharris@oplink.net <rlharris@oplink.net> [2015-08-27 02:09 -0500]: > > > > [...] > > > > > > How can I determine the address without reinstalling? > > > > $ host $(hostname) > > $ host junk > Host junk not found: 3(NXDOMAIN) > $ > > ... whether junk is localhost, another PC on the LAN, or indeed "junk". So junk isn't assigned to your LAN's DHCP/DNS server. Elimar -- Never make anything simple and efficient when a way can be found to make it complex and wonderful ;-)
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2015-08-28 06:40 +0200 |
| Message-ID | <q2jCh-Zu-9@gated-at.bofh.it> |
| In reply to | #156925 |
Quoting Elimar Riesebieter (riesebie@lxtec.de): > * David Wright <deblis@lionunicorn.co.uk> [2015-08-27 13:29 -0500]: > > > Quoting Elimar Riesebieter (riesebie@lxtec.de): > > > * rlharris@oplink.net <rlharris@oplink.net> [2015-08-27 02:09 -0500]: > > > > > > [...] > > > > > > > > How can I determine the address without reinstalling? > > > > > > $ host $(hostname) I was trying to ascertain the usefulness of this command in a LAN context. > > $ host junk > > Host junk not found: 3(NXDOMAIN) > > $ > > > > ... whether junk is localhost, another PC on the LAN, or indeed "junk". IOW whatever I substitute for "junk", I get the same reply. > So junk isn't assigned to your LAN's DHCP/DNS server. Correct. It's not. I tried putting in the name of this computer, another (existing) computer and for completion, a non-existent computer. After all, the message for the latter case might have been different, which would indicate the command was doing *something* even if it wasn't particularly useful. Or, to spell it out: $ host localhost Host localhost not found: 3(NXDOMAIN) $ ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms [...] $ host alum Host alum not found: 3(NXDOMAIN) $ ping alum PING alum (127.0.1.1) 56(84) bytes of data. 64 bytes from alum (127.0.1.1): icmp_req=1 ttl=64 time=0.036 ms [...] $ host west Host west not found: 3(NXDOMAIN) $ ping west PING west (192.168.1.15) 56(84) bytes of data. 64 bytes from west (192.168.1.15): icmp_req=1 ttl=64 time=5.61 ms [...] $ host junk Host junk not found: 3(NXDOMAIN) $ ping junk ping: unknown host junk $ and from west: $ host alum Host alum not found: 3(NXDOMAIN) $ ping alum PING alum (192.168.1.19) 56(84) bytes of data. 64 bytes from alum (192.168.1.19): icmp_seq=1 ttl=64 time=5.30 ms [...] $ But just to show that I really do exist: $ host www.google.com www.google.com has address 173.194.115.18 www.google.com has address 173.194.115.20 www.google.com has address 173.194.115.16 www.google.com has address 173.194.115.19 www.google.com has address 173.194.115.17 www.google.com has IPv6 address 2607:f8b0:4000:806::1012 $ Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Curt <curty@free.fr> |
|---|---|
| Date | 2015-08-28 12:10 +0200 |
| Message-ID | <q2oLE-6n-21@gated-at.bofh.it> |
| In reply to | #156934 |
On 2015-08-28, David Wright <deblis@lionunicorn.co.uk> wrote: > > $ host localhost > Host localhost not found: 3(NXDOMAIN) > $ ping localhost > PING localhost (127.0.0.1) 56(84) bytes of data. > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms curty@einstein:~$ host localhost localhost has address 127.0.0.1 localhost has IPv6 address ::1
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2015-08-28 13:10 +0200 |
| Message-ID | <q2pHI-1s8-35@gated-at.bofh.it> |
| In reply to | #156946 |
On Fri 28 Aug 2015 at 10:01:59 +0000, Curt wrote: > On 2015-08-28, David Wright <deblis@lionunicorn.co.uk> wrote: > > > > $ host localhost > > Host localhost not found: 3(NXDOMAIN) > > $ ping localhost > > PING localhost (127.0.0.1) 56(84) bytes of data. > > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms > > curty@einstein:~$ host localhost > localhost has address 127.0.0.1 > localhost has IPv6 address ::1 To complete the picture: brian@desktop:~$ dig -x 127.0.0.1 ; <<>> DiG 9.9.5-9-Debian <<>> -x 127.0.0.1 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7146 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;1.0.0.127.in-addr.arpa. IN PTR ;; ANSWER SECTION: 1.0.0.127.in-addr.arpa. 10800 IN PTR localhost. ;; Query time: 24 msec ;; SERVER: 158.152.1.43#53(158.152.1.43) ;; WHEN: Fri Aug 28 12:03:15 BST 2015 ;; MSG SIZE rcvd: 74 host and dig use only the DNS. Elimar's suggestion to use 'host $(hostname)' will work if hostname is a FQDN. But it shouldn't (or wouldn't) be on a stock Debian system.
[toc] | [prev] | [next] | [standalone]
| From | Reco <recoverym4n@gmail.com> |
|---|---|
| Date | 2015-08-28 13:50 +0200 |
| Message-ID | <q2qkq-2bz-13@gated-at.bofh.it> |
| In reply to | #156948 |
Hi. On Fri, 28 Aug 2015 12:09:08 +0100 Brian <ad44@cityscape.co.uk> wrote: > On Fri 28 Aug 2015 at 10:01:59 +0000, Curt wrote: > > > On 2015-08-28, David Wright <deblis@lionunicorn.co.uk> wrote: > > > > > > $ host localhost > > > Host localhost not found: 3(NXDOMAIN) > > > $ ping localhost > > > PING localhost (127.0.0.1) 56(84) bytes of data. > > > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms > > > > curty@einstein:~$ host localhost > > localhost has address 127.0.0.1 > > localhost has IPv6 address ::1 > > To complete the picture: > > brian@desktop:~$ dig -x 127.0.0.1 > > ; <<>> DiG 9.9.5-9-Debian <<>> -x 127.0.0.1 > ;; global options: +cmd > ;; Got answer: > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7146 > ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 > > ;; OPT PSEUDOSECTION: > ; EDNS: version: 0, flags:; udp: 4096 > ;; QUESTION SECTION: > ;1.0.0.127.in-addr.arpa. IN PTR > > ;; ANSWER SECTION: > 1.0.0.127.in-addr.arpa. 10800 IN PTR localhost. > > ;; Query time: 24 msec > ;; SERVER: 158.152.1.43#53(158.152.1.43) > ;; WHEN: Fri Aug 28 12:03:15 BST 2015 > ;; MSG SIZE rcvd: 74 > > host and dig use only the DNS. > > Elimar's suggestion to use 'host $(hostname)' will work if hostname is > a FQDN. But it shouldn't (or wouldn't) be on a stock Debian system. Not unless said 'stock Debian system' has 'search <domain>' stanza in /etc/resolv.conf. Reco
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2015-08-28 15:40 +0200 |
| Message-ID | <q2s2T-4H9-7@gated-at.bofh.it> |
| In reply to | #156949 |
On Fri 28 Aug 2015 at 14:45:32 +0300, Reco wrote: > Hi. > > On Fri, 28 Aug 2015 12:09:08 +0100 > Brian <ad44@cityscape.co.uk> wrote: > > > On Fri 28 Aug 2015 at 10:01:59 +0000, Curt wrote: > > > > > On 2015-08-28, David Wright <deblis@lionunicorn.co.uk> wrote: > > > > > > > > $ host localhost > > > > Host localhost not found: 3(NXDOMAIN) > > > > $ ping localhost > > > > PING localhost (127.0.0.1) 56(84) bytes of data. > > > > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms > > > > > > curty@einstein:~$ host localhost > > > localhost has address 127.0.0.1 > > > localhost has IPv6 address ::1 > > > > To complete the picture: > > > > brian@desktop:~$ dig -x 127.0.0.1 > > > > ; <<>> DiG 9.9.5-9-Debian <<>> -x 127.0.0.1 > > ;; global options: +cmd > > ;; Got answer: > > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7146 > > ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 > > > > ;; OPT PSEUDOSECTION: > > ; EDNS: version: 0, flags:; udp: 4096 > > ;; QUESTION SECTION: > > ;1.0.0.127.in-addr.arpa. IN PTR > > > > ;; ANSWER SECTION: > > 1.0.0.127.in-addr.arpa. 10800 IN PTR localhost. > > > > ;; Query time: 24 msec > > ;; SERVER: 158.152.1.43#53(158.152.1.43) > > ;; WHEN: Fri Aug 28 12:03:15 BST 2015 > > ;; MSG SIZE rcvd: 74 > > > > host and dig use only the DNS. > > > > Elimar's suggestion to use 'host $(hostname)' will work if hostname is > > a FQDN. But it shouldn't (or wouldn't) be on a stock Debian system. > > Not unless said 'stock Debian system' has 'search <domain>' stanza > in /etc/resolv.conf. Does "search example.org" count? :) What is not understandable (to me) is why 'host localhost' resolves for some but not for others and why it is thought 'host $(hostname)' should resolve in the DNS.
[toc] | [prev] | [next] | [standalone]
| From | Reco <recoverym4n@gmail.com> |
|---|---|
| Date | 2015-08-28 16:10 +0200 |
| Message-ID | <q2svU-5uI-19@gated-at.bofh.it> |
| In reply to | #156964 |
Hi.
On Fri, 28 Aug 2015 14:35:09 +0100
Brian <ad44@cityscape.co.uk> wrote:
> On Fri 28 Aug 2015 at 14:45:32 +0300, Reco wrote:
>
> > Hi.
> >
> > On Fri, 28 Aug 2015 12:09:08 +0100
> > Brian <ad44@cityscape.co.uk> wrote:
> >
> > > On Fri 28 Aug 2015 at 10:01:59 +0000, Curt wrote:
> > >
> > > > On 2015-08-28, David Wright <deblis@lionunicorn.co.uk> wrote:
> > > > >
> > > > > $ host localhost
> > > > > Host localhost not found: 3(NXDOMAIN)
> > > > > $ ping localhost
> > > > > PING localhost (127.0.0.1) 56(84) bytes of data.
> > > > > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms
> > > >
> > > > curty@einstein:~$ host localhost
> > > > localhost has address 127.0.0.1
> > > > localhost has IPv6 address ::1
> > >
> > > To complete the picture:
> > >
> > > brian@desktop:~$ dig -x 127.0.0.1
> > >
> > > ; <<>> DiG 9.9.5-9-Debian <<>> -x 127.0.0.1
> > > ;; global options: +cmd
> > > ;; Got answer:
> > > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7146
> > > ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
> > >
> > > ;; OPT PSEUDOSECTION:
> > > ; EDNS: version: 0, flags:; udp: 4096
> > > ;; QUESTION SECTION:
> > > ;1.0.0.127.in-addr.arpa. IN PTR
> > >
> > > ;; ANSWER SECTION:
> > > 1.0.0.127.in-addr.arpa. 10800 IN PTR localhost.
> > >
> > > ;; Query time: 24 msec
> > > ;; SERVER: 158.152.1.43#53(158.152.1.43)
> > > ;; WHEN: Fri Aug 28 12:03:15 BST 2015
> > > ;; MSG SIZE rcvd: 74
> > >
> > > host and dig use only the DNS.
> > >
> > > Elimar's suggestion to use 'host $(hostname)' will work if hostname is
> > > a FQDN. But it shouldn't (or wouldn't) be on a stock Debian system.
> >
> > Not unless said 'stock Debian system' has 'search <domain>' stanza
> > in /etc/resolv.conf.
>
> Does "search example.org" count? :)
It should count for the hosts in this domain. Provided, of course, that
one needs to resolve 'bare' hostnames (i.e. non-FQDN).
> What is not understandable (to me) is why 'host localhost' resolves for
> some but not for others and why it is thought 'host $(hostname)' should
> resolve in the DNS.
Stock Debian BIND configuration includes this wonderful snippet
(/etc/bind/db.local):
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 127.0.0.1
@ IN AAAA ::1
Translating this to English - every BIND installed on Debian considers
itself the final authority on "localhost" zone and always returns
127.0.0.1 for A queries (IPv4) and ::1 for AAAA queries (IPv6).
Other Linux distributions can store zone files elsewhere, but the
principle is the same.
Interpreting /etc/bind/db.127 (PTR entries) is left for an exercise for
the readers.
So - 'host localhost' *should* work given an ideal world (because in
ideal world everyone will use an ideal DNS, which is BIND). But:
a) There are other DNSes. Some of them even may be configured in a sane
way, if you're lucky. In the case of doubt - use 'dig' or 'tcpdump'.
b) There's endless amount of quirks in client resolvers. In layman
terms - 'which part of "search" should I append to the bare hostname'.
In the case of doubt - use 'tcpdump'.
Reco
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2015-08-28 16:50 +0200 |
| Message-ID | <q2t8C-6dU-17@gated-at.bofh.it> |
| In reply to | #156967 |
On Fri 28 Aug 2015 at 17:00:59 +0300, Reco wrote: > Hi. > > On Fri, 28 Aug 2015 14:35:09 +0100 > Brian <ad44@cityscape.co.uk> wrote: > > > On Fri 28 Aug 2015 at 14:45:32 +0300, Reco wrote: > > > > > Hi. > > > > > > On Fri, 28 Aug 2015 12:09:08 +0100 > > > Brian <ad44@cityscape.co.uk> wrote: > > > > > > > On Fri 28 Aug 2015 at 10:01:59 +0000, Curt wrote: > > > > > > > > > On 2015-08-28, David Wright <deblis@lionunicorn.co.uk> wrote: > > > > > > > > > > > > $ host localhost > > > > > > Host localhost not found: 3(NXDOMAIN) > > > > > > $ ping localhost > > > > > > PING localhost (127.0.0.1) 56(84) bytes of data. > > > > > > 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.032 ms > > > > > > > > > > curty@einstein:~$ host localhost > > > > > localhost has address 127.0.0.1 > > > > > localhost has IPv6 address ::1 > > > > > > > > To complete the picture: > > > > > > > > brian@desktop:~$ dig -x 127.0.0.1 > > > > > > > > ; <<>> DiG 9.9.5-9-Debian <<>> -x 127.0.0.1 > > > > ;; global options: +cmd > > > > ;; Got answer: > > > > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7146 > > > > ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 > > > > > > > > ;; OPT PSEUDOSECTION: > > > > ; EDNS: version: 0, flags:; udp: 4096 > > > > ;; QUESTION SECTION: > > > > ;1.0.0.127.in-addr.arpa. IN PTR > > > > > > > > ;; ANSWER SECTION: > > > > 1.0.0.127.in-addr.arpa. 10800 IN PTR localhost. > > > > > > > > ;; Query time: 24 msec > > > > ;; SERVER: 158.152.1.43#53(158.152.1.43) > > > > ;; WHEN: Fri Aug 28 12:03:15 BST 2015 > > > > ;; MSG SIZE rcvd: 74 > > > > > > > > host and dig use only the DNS. > > > > > > > > Elimar's suggestion to use 'host $(hostname)' will work if hostname is > > > > a FQDN. But it shouldn't (or wouldn't) be on a stock Debian system. > > > > > > Not unless said 'stock Debian system' has 'search <domain>' stanza > > > in /etc/resolv.conf. > > > > Does "search example.org" count? :) > > It should count for the hosts in this domain. Provided, of course, that > one needs to resolve 'bare' hostnames (i.e. non-FQDN). > > > > What is not understandable (to me) is why 'host localhost' resolves for > > some but not for others and why it is thought 'host $(hostname)' should > > resolve in the DNS. > > Stock Debian BIND configuration includes this wonderful snippet > (/etc/bind/db.local): > > ; > ; BIND data file for local loopback interface > ; > $TTL 604800 > @ IN SOA localhost. root.localhost. ( > 2 ; Serial > 604800 ; Refresh > 86400 ; Retry > 2419200 ; Expire > 604800 ) ; Negative Cache TTL > ; > @ IN NS localhost. > @ IN A 127.0.0.1 > @ IN AAAA ::1 > > Translating this to English - every BIND installed on Debian considers > itself the final authority on "localhost" zone and always returns > 127.0.0.1 for A queries (IPv4) and ::1 for AAAA queries (IPv6). > Other Linux distributions can store zone files elsewhere, but the > principle is the same. > Interpreting /etc/bind/db.127 (PTR entries) is left for an exercise for > the readers. > > > So - 'host localhost' *should* work given an ideal world (because in > ideal world everyone will use an ideal DNS, which is BIND). But: > > a) There are other DNSes. Some of them even may be configured in a sane > way, if you're lucky. In the case of doubt - use 'dig' or 'tcpdump'. > > b) There's endless amount of quirks in client resolvers. In layman > terms - 'which part of "search" should I append to the bare hostname'. > In the case of doubt - use 'tcpdump'. Thanks for the nice explanation. It lead me to RFC 6761 https://tools.ietf.org/html/rfc6761 There it says: Name resolution APIs and libraries SHOULD recognize localhost names as special and SHOULD always return the IP loopback address for address queries and negative responses for all other query types. Name resolution APIs SHOULD NOT send queries for localhost names to their configured caching DNS server(s). I think I'll leave this topic at this point before I get in over my head, but the implication here is that a resolver not giving 127.0.0.1 for localhost is broken in some way.
[toc] | [prev] | [next] | [standalone]
| From | Curt <curty@free.fr> |
|---|---|
| Date | 2015-08-28 18:20 +0200 |
| Message-ID | <q2uxI-8nz-9@gated-at.bofh.it> |
| In reply to | #156973 |
On 2015-08-28, Brian <ad44@cityscape.co.uk> wrote: > > I think I'll leave this topic at this point before I get in over my > head, but the implication here is that a resolver not giving 127.0.0.1 > for localhost is broken in some way. > So I'm not broken somehow.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.debian.user
csiph-web