[opensuse] Set static IP adress for some domain
Dear opensuse users, I'm running the latest opensuse leap 15.1 just today I ran into a situation where I needed to point a domain to a specific IP adress. If I'm on my windows client I just update the hosts file 112.202.123.179 somedomain.com copy that file to /windows/system32/drivers/etc open a terminal and run 'ipconfig /flushdns' and voila ... whatever way I try to access the domain, e.g. do a ping or visit the domain in a web browser it points to the IP adress defined in the hosts file. How can I do this on an opensuse box? there's also a /etc/hosts file but it doesn't seem to get picked up? there's also a DNS running on the box (same like on the windows computer) but I just want this specific domain to have a specific static IP address I've already looked into /etc/hosts.conf ... /etc/resolver.conf ... /etc/nsswitch.conf ... or whatsoever ... Still without any luck at all ;) Is it really that difficult? I'm more that grateful for any insight. thanks & greetings Becki -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 25/04/2020 13.15, Admin Beckspaced wrote:
Dear opensuse users,
I'm running the latest opensuse leap 15.1
just today I ran into a situation where I needed to point a domain to a specific IP adress.
If I'm on my windows client I just update the hosts file
112.202.123.179 somedomain.com
copy that file to /windows/system32/drivers/etc
open a terminal and run 'ipconfig /flushdns'
and voila ... whatever way I try to access the domain, e.g. do a ping or visit the domain in a web browser it points to the IP adress defined in the hosts file.
How can I do this on an opensuse box?
there's also a /etc/hosts file but it doesn't seem to get picked up?
Yes, it is used. Telcontar:~ # tail /etc/hosts 127.0.0.1 best.aliexpress.com 127.0.0.1 follamigos.com 127.0.0.1 commercego.site 127.0.0.1 gametracker.club 127.0.0.1 fastfreeredics105.live 127.0.0.1 bestdateshere-for23.com 127.0.0.1 bestdateshere-for23.com 112.202.123.179 somedomain.com Telcontar:~ # Telcontar:~ # host somedomain.com somedomain.com has address 185.53.177.54 somedomain.com mail is handled by 5 mail.h-email.net. Telcontar:~ # ping somedomain.com PING somedomain.com (112.202.123.179) 56(84) bytes of data. ^C --- somedomain.com ping statistics --- 6 packets transmitted, 0 received, 100% packet loss, time 5115ms Telcontar:~ # As you see, it works - but not with the command hosts, which is documented to ignore it. By the way, "somedomain.com" does exist, as you can see above.
there's also a DNS running on the box (same like on the windows computer) but I just want this specific domain to have a specific static IP address
I've already looked into /etc/hosts.conf ... /etc/resolver.conf ... /etc/nsswitch.conf ... or whatsoever ...
Have you modified them? Because you can disable the hosts file. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
As you see, it works - but not with the command hosts, which is documented to ignore it.
Yes, 'host' is a BIND utility, for doing actual DNS lookups, not for regular name resolving. A subtle but important difference. -- Per Jessen, Zürich (22.2°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Admin Beckspaced <admin@beckspaced.com> [04-25-20 07:19]:
Dear opensuse users,
I'm running the latest opensuse leap 15.1
just today I ran into a situation where I needed to point a domain to a specific IP adress.
If I'm on my windows client I just update the hosts file
112.202.123.179 somedomain.com
copy that file to /windows/system32/drivers/etc
open a terminal and run 'ipconfig /flushdns'
and voila ... whatever way I try to access the domain, e.g. do a ping or visit the domain in a web browser it points to the IP adress defined in the hosts file.
How can I do this on an opensuse box?
there's also a /etc/hosts file but it doesn't seem to get picked up?
there's also a DNS running on the box (same like on the windows computer) but I just want this specific domain to have a specific static IP address
to have current box access ThisBox as 112.202.123.179, simply add to /etc/hosts, 112.202.123.179 somedomain.com ThisBox no need to do any refresh and "ifconfig" is the depricated linux invocation for ipconfig, now "ip" https://www.tecmint.com/ifconfig-vs-ip-command-comparing-network-configurati... ifconfig ip a -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 25/04/2020 07:15, Admin Beckspaced wrote:
there's also a /etc/hosts file but it doesn't seem to get picked up?
What are you expecting it to be picked up by? No, really, as others commented, that's all it should take, so you've got something else going on. I'd suspect some sort of caching. In all my years I've never observed quite this.
there's also a DNS running on the box (same like on the windows computer)
I doubt that very much Linux is not Windows. Perhaps be more precise: which version of DNS are you running. For example, I'm running DNSMasq and the first things it does WHEN IT STARTS OR RESTARTS is read /etc/hosts. Any queries from programs that run though it before that -re-read might produce the phenomena you describe. So what DNS server (and cache) you are running and HOW IT IS CONFIGURED matters if we are to advise you. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 25.04.2020 um 14:03 schrieb Anton Aylward:
On 25/04/2020 07:15, Admin Beckspaced wrote:
there's also a /etc/hosts file but it doesn't seem to get picked up?
What are you expecting it to be picked up by?
No, really, as others commented, that's all it should take, so you've got something else going on. I'd suspect some sort of caching. In all my years I've never observed quite this.
there's also a DNS running on the box (same like on the windows computer) I doubt that very much Linux is not Windows. Perhaps be more precise: which version of DNS are you running.
For example, I'm running DNSMasq and the first things it does WHEN IT STARTS OR RESTARTS is read /etc/hosts. Any queries from programs that run though it before that -re-read might produce the phenomena you describe.
So what DNS server (and cache) you are running and HOW IT IS CONFIGURED matters if we are to advise you. Hello there ;)
never expected that my question about /etc/hosts would raise such attention and receive multiple feedbacks from the list. An entry in /etc/hosts 112.202.123.179 somedomain.com DOES axctually work but it depends how you query the IP address I did query via 'host' or 'dig' but these tools do a direct query to the nameserver. I don't have bind running on the server but forward to external DNS server So if I do a 'ping' lookup via /etc/hosts works. As pointed out by a few people DNSMasq is what I'm looking for. Thanks for all your comments, ideas and hints. & sorry for all the trouble. Greetings Becki -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Admin Beckspaced wrote:
An entry in /etc/hosts
112.202.123.179 somedomain.com
DOES axctually work but it depends how you query the IP address
I did query via 'host' or 'dig' but these tools do a direct query to the nameserver. I don't have bind running on the server but forward to external DNS server
So if I do a 'ping' lookup via /etc/hosts works.
As pointed out by a few people DNSMasq is what I'm looking for.
Judging by your initial question, an entry in /etc/hosts will be enough. -- Per Jessen, Zürich (15.7°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 26/04/2020 09.47, Admin Beckspaced wrote:
Am 25.04.2020 um 14:03 schrieb Anton Aylward:
On 25/04/2020 07:15, Admin Beckspaced wrote:
Hello there ;)
never expected that my question about /etc/hosts would raise such attention and receive multiple feedbacks from the list.
An entry in /etc/hosts
112.202.123.179 somedomain.com
DOES axctually work but it depends how you query the IP address
I did query via 'host' or 'dig' but these tools do a direct query to the nameserver. I don't have bind running on the server but forward to external DNS server
So if I do a 'ping' lookup via /etc/hosts works.
As pointed out by a few people DNSMasq is what I'm looking for.
Er... you have a little confusion here. The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion. Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access. -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 26/04/2020 14.52, Ruben Safir wrote:
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access.
Yes, it must. It has a precise purpose, documented. Telcontar:~ # rpm -qf `which dig` bind-utils-9.11.2-lp151.11.6.1.x86_64 Telcontar:~ # -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On Sun, 26 Apr 2020 21:54:56 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 26/04/2020 14.52, Ruben Safir wrote:
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access.
Yes, it must. It has a precise purpose, documented.
I think there's some confusion about terminology. dig does not ignore the resolver: man dig: "Unless it is told to query a specific name server, dig will try each of the servers listed in /etc/resolv.conf." man resolver: "The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information. "If this file does not exist, only the name server on the local machine will be queried; the domain name is determined from the hostname and the domain search path is constructed from the domain name." man resolv.conf: "resolv.conf - resolver configuration file" So dig does use the resolver. The difference is, I think that ping typically ALSO uses /etc/hosts first, as usually instructd by /etc/nsswitch.conf So dig and ping can behave differently. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 27/04/2020 12.28, Dave Howorth wrote:
On Sun, 26 Apr 2020 21:54:56 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 26/04/2020 14.52, Ruben Safir wrote:
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access.
Yes, it must. It has a precise purpose, documented.
I think there's some confusion about terminology.
dig does not ignore the resolver:
man dig: "Unless it is told to query a specific name server, dig will try each of the servers listed in /etc/resolv.conf."
I meant in the sense of ignoring or not using /etc/hosts. And of course, it can be told to directly query dns servers not listed in resolv.conf. man dig: "Unless it is told to query a specific name server, dig will try each of the servers listed in /etc/resolv.conf. If no usable server addresses are found, dig will send the query to the local host." -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On Mon, 27 Apr 2020 13:36:16 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 27/04/2020 12.28, Dave Howorth wrote:
On Sun, 26 Apr 2020 21:54:56 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 26/04/2020 14.52, Ruben Safir wrote:
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access.
Yes, it must. It has a precise purpose, documented.
I think there's some confusion about terminology.
dig does not ignore the resolver:
man dig: "Unless it is told to query a specific name server, dig will try each of the servers listed in /etc/resolv.conf."
I meant in the sense of ignoring or not using /etc/hosts. And of course, it can be told to directly query dns servers not listed in resolv.conf.
But that has nothing to do with the resolver. It doesn't ignore the resolver, unless you tell it to. But the resolver does not use /etc/nsswitch.conf Selectively quoting my references does not make things clearer!!!!!!!
man dig: "Unless it is told to query a specific name server, dig will try each of the servers listed in /etc/resolv.conf. If no usable server addresses are found, dig will send the query to the local host."
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 27/04/2020 13.56, Dave Howorth wrote:
On Mon, 27 Apr 2020 13:36:16 +0200 "Carlos E. R." <> wrote:
But that has nothing to do with the resolver. It doesn't ignore the resolver, unless you tell it to. But the resolver does not use /etc/nsswitch.conf Selectively quoting my references does not make things clearer!!!!!!!
Sorry, I trimmed the text simply to reduce email size. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Dave Howorth wrote:
On Sun, 26 Apr 2020 21:54:56 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 26/04/2020 14.52, Ruben Safir wrote:
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access.
Yes, it must. It has a precise purpose, documented.
I think there's some confusion about terminology.
dig does not ignore the resolver:
It is as you say a matter of terminology. I would still say 'dig' ignores the resolver, as in the glibc resolver. (which includes nscd and looking at nsswitch.conf, hence optionally /etc/hosts). 'dig' and 'host' both only talk to a nameserver. -- Per Jessen, Zürich (21.1°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 26.04.2020 um 14:02 schrieb Carlos E. R.:
On 26/04/2020 09.47, Admin Beckspaced wrote:
Am 25.04.2020 um 14:03 schrieb Anton Aylward:
On 25/04/2020 07:15, Admin Beckspaced wrote:
Hello there ;)
never expected that my question about /etc/hosts would raise such attention and receive multiple feedbacks from the list.
An entry in /etc/hosts
112.202.123.179 somedomain.com
DOES axctually work but it depends how you query the IP address
I did query via 'host' or 'dig' but these tools do a direct query to the nameserver. I don't have bind running on the server but forward to external DNS server
So if I do a 'ping' lookup via /etc/hosts works.
As pointed out by a few people DNSMasq is what I'm looking for.
Er... you have a little confusion here.
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
yes, indeed. Had some little confusion here ;) my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there. I was not aware that postfix is doing a direct DNS query. so while ping was working on the dev box postfix actually still got the wrong IP address. that was the only confusion I had there. Using DNSMasq will perhaps solve the issue but didn't have time yet to look into it. hopefully this will clear up thing? anyway ... thanks a lot for all your help, hints & explanations Thanks & greetings Becki -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Admin Beckspaced wrote:
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there.
I was not aware that postfix is doing a direct DNS query.
Maybe see the postfix "smtp_host_lookup" directive. http://www.postfix.org/postconf.5.html#smtp_host_lookup Setting up dnsmasq for this is overkill, imho. The easy solution is: smtp_host_lookup = dns,native. -- Per Jessen, Zürich (16.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 26/04/2020 20.24, Per Jessen wrote:
Admin Beckspaced wrote:
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there.
I was not aware that postfix is doing a direct DNS query.
Maybe see the postfix "smtp_host_lookup" directive.
http://www.postfix.org/postconf.5.html#smtp_host_lookup
Setting up dnsmasq for this is overkill, imho.
The easy solution is:
smtp_host_lookup = dns,native.
Ah! Interesting :-) When I first hit that problem, about two decades ago, I was using sendmail. So when I switched to postfix I kept using the same method: local dns server (which at the time, was bind9 (it is confusing whether it is called bind9 or named or both). However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
So when I switched to postfix I kept using the same method: local dns server (which at the time, was bind9 (it is confusing whether it is called bind9 or named or both).
BIND9 is the project name, 'named' is the name of the daemon. -- Per Jessen, Zürich (15.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 26 Apr 2020 21:47:30 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 26/04/2020 20.24, Per Jessen wrote:
Admin Beckspaced wrote:
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there.
I was not aware that postfix is doing a direct DNS query.
Maybe see the postfix "smtp_host_lookup" directive.
http://www.postfix.org/postconf.5.html#smtp_host_lookup
Setting up dnsmasq for this is overkill, imho.
The easy solution is:
smtp_host_lookup = dns,native.
Ah! Interesting :-)
When I first hit that problem, about two decades ago, I was using sendmail. So when I switched to postfix I kept using the same method: local dns server (which at the time, was bind9 (it is confusing whether it is called bind9 or named or both).
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router. And it certainly doesn't affect my web browser, since firefox uses its own system, which in my case is DOH to cloudflare. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 27/04/2020 12.30, Dave Howorth wrote:
On Sun, 26 Apr 2020 21:47:30 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 26/04/2020 20.24, Per Jessen wrote:
Admin Beckspaced wrote:
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there.
I was not aware that postfix is doing a direct DNS query.
Maybe see the postfix "smtp_host_lookup" directive.
http://www.postfix.org/postconf.5.html#smtp_host_lookup
Setting up dnsmasq for this is overkill, imho.
The easy solution is:
smtp_host_lookup = dns,native.
Ah! Interesting :-)
When I first hit that problem, about two decades ago, I was using sendmail. So when I switched to postfix I kept using the same method: local dns server (which at the time, was bind9 (it is confusing whether it is called bind9 or named or both).
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router.
Depends on the router :-) The computer has more memory, can store more entries. In the past, the time of modems, it made a notable difference.
And it certainly doesn't affect my web browser, since firefox uses its own system, which in my case is DOH to cloudflare.
By default, it uses the system. Has to, or local names would not resolve. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Dave Howorth wrote:
On Sun, 26 Apr 2020 21:47:30 +0200
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router.
Does your router actually have a DNS server? -- Per Jessen, Zürich (20.1°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 27/04/2020 14.24, Per Jessen wrote:
Dave Howorth wrote:
On Sun, 26 Apr 2020 21:47:30 +0200
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router.
Does your router actually have a DNS server?
They often have some type of DNS cache, not actually a DNS server, because you can not define names. Or what would be very nice, coordinate it with the included DHCP server in the router. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
On 27/04/2020 14.24, Per Jessen wrote:
Dave Howorth wrote:
On Sun, 26 Apr 2020 21:47:30 +0200
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router.
Does your router actually have a DNS server?
They often have some type of DNS cache, not actually a DNS server, because you can not define names.
Okay - I haven't used a SOHO router for years, they have clearly moved on. -- Per Jessen, Zürich (20.8°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-04-27 08:46 AM, Per Jessen wrote:
Okay - I haven't used a SOHO router for years, they have clearly moved on.
Take a look at something running OpenWRT, for example. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-04-27 08:32 AM, Carlos E. R. wrote:
Does your router actually have a DNS server?
They often have some type of DNS cache, not actually a DNS server, because you can not define names. Or what would be very nice, coordinate it with the included DHCP server in the router.
Perhaps not consumer grade, but business level routers often have a DNS server available. Here's part of what Cisco says: "Configuring the Device as a DNS Server Perform this task to configure the device as a DNS server. A Cisco IOS device can provide service to DNS clients, acting as both a caching name server and as an authoritative name server for its own local host table. When configured as a caching name server, the device relays DNS requests to other name servers that resolve network names into network addresses. The caching name server caches information learned from other name servers so that it can answer requests quickly, without having to query other servers for each transaction. When configured as an authoritative name server for its own local host table, the device listens on port 53 for DNS queries and then answers DNS queries using the permanent and cached entries in its own host table. " I currently use pfSense for my router/firewall and previously, SuSE. Both provided DNS servers. If I'm not mistaken the *WRT gear does too. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-04-27 08:24 AM, Per Jessen wrote:
I'm surprised a local DNS server makes much difference versus the default one on my router. Does your router actually have a DNS server?
Mine does. I'm running pfSense on a computer. By default pfSense provides a DNS resolver, which goes to the top level servers, instead of the ones provided by ISPs, Google, etc.. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 27 Apr 2020 14:24:19 +0200 Per Jessen <per@computer.org> wrote:
Dave Howorth wrote:
On Sun, 26 Apr 2020 21:47:30 +0200
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router.
Does your router actually have a DNS server?
$ cat /etc/resolv.conf # [snip comments] search lan fritz.box nameserver 192.168.1.1 $ host google.com fritz.box Using domain server: Name: fritz.box Address: 192.168.1.1#53 Aliases: google.com has address 172.217.20.142 [snip additional information] $ nslookup google.com Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: google.com Address: 172.217.20.142 Name: google.com Address: 2a00:1450:4009:801::200e -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Dave Howorth wrote:
On Mon, 27 Apr 2020 14:24:19 +0200 Per Jessen <per@computer.org> wrote:
Dave Howorth wrote:
On Sun, 26 Apr 2020 21:47:30 +0200
However, a local dns server also speeds up the operation of other daemons, such as postfix, spamassassin, etc. Even the web browser.
I'm surprised a local DNS server makes much difference versus the default one on my router.
Does your router actually have a DNS server?
$ cat /etc/resolv.conf # [snip comments] search lan fritz.box nameserver 192.168.1.1
Right - which doesn't necessarily mean the box has a DNS server though. It could simply be NAT'ing everything and passing it on to the upstream DNS from your provider. (or whatever you have configured). -- Per Jessen, Zürich (22.4°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 26/04/2020 14:24, Per Jessen wrote:
Admin Beckspaced wrote:
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there.
I was not aware that postfix is doing a direct DNS query.
Maybe see the postfix "smtp_host_lookup" directive.
http://www.postfix.org/postconf.5.html#smtp_host_lookup
Setting up dnsmasq for this is overkill, imho.
The easy solution is:
smtp_host_lookup = dns,native.
In effect, Postfix is implementing its own /etc/nsswitch.conf -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 26/04/2020 19.30, Admin Beckspaced wrote:
Am 26.04.2020 um 14:02 schrieb Carlos E. R.:
On 26/04/2020 09.47, Admin Beckspaced wrote:
Am 25.04.2020 um 14:03 schrieb Anton Aylward:
On 25/04/2020 07:15, Admin Beckspaced wrote:
...
yes, indeed. Had some little confusion here ;)
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain So I needed a quick fix to point a domain to another IP on the dev box. Then I thought ... hey, let's use /etc/hosts and define an IP adress there.
I was not aware that postfix is doing a direct DNS query.
so while ping was working on the dev box postfix actually still got the wrong IP address.
that was the only confusion I had there.
Ah, yes, I hit the same problem long ago, I had forgotten :-)
Using DNSMasq will perhaps solve the issue but didn't have time yet to look into it.
hopefully this will clear up thing?
anyway ... thanks a lot for all your help, hints & explanations
DNSMasq is very easy to use, specially when compared with "bind" which is the powerful tool most used. Basically, DNSmasq reads the /etc/hosts file, and makes a name server out of that information (or you can use a separate file, and tell dnsmasq to not read the hosts file). You only need some tiny changes to adjust. For example, in mine, I did these changes: /etc/dnsmasq.conf: #no-resolv #server=192.168.1.1 server=1.1.1.1 server=1.0.0.1 local=/valinor/ #conf-dir=/etc/dnsmasq.d/,*.conf # I don't remember why :-? /etc/resolv.conf: domain Valinor nameserver 127.0.0.1 /etc/host.conf: order hosts, bind multi on And that's it, I think. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 26/04/2020 15:30, Carlos E. R. wrote:
/etc/resolv.conf: domain Valinor nameserver 127.0.0.1
/etc/host.conf: order hosts, bind multi on
The man page for host.conf says The nsswitch.conf(5) file is the modern way of controlling the order of host lookups. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 27/04/2020 02.28, Anton Aylward wrote:
On 26/04/2020 15:30, Carlos E. R. wrote:
/etc/resolv.conf: domain Valinor nameserver 127.0.0.1
/etc/host.conf: order hosts, bind multi on
The man page for host.conf says
The nsswitch.conf(5) file is the modern way of controlling the order of host lookups.
And the inline documentation for host.conf says "This line should be in sync with the "hosts" option in /etc/nsswitch.conf." -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 26/04/2020 13:30, Admin Beckspaced wrote:
my problem was that on my dev box postfix, asd it usually does, is using DNS to lookup IP address of a domain
Let's be precise: Postix is documented, if you searched the man pages or even google for the O'Reilly pages, uses the system DNS. It doesn't matter, therefore, whether the system DNS is DNSMasq, BIND, or configured to use static files. The file /etc/nsswitch.conf is there to determine this Your assertion above is true IF AND ONLY IF the line for hosts in that file reads hosts: dns In which case you should have told us your DNS service configuration from /etc/resolve.conf to start with. Now mine reads hosts: files dns But what difference does that make? I run DNSMasq which reads in /etc/hosts when it starts at boot. OR IF I EXPLICITLY TELL IT TO READ. So I can _experiment_ by altering /etc/hosts since the resolver reads that first with *MY* configuration. (And trust me, the way I have DNSMasq & Postfix set up you don't want to know the rest of my configuration. It's taken years, also does spam filtering at the DNS, the Postfix and the SpamAssassin levels, and some within Thunderbird.) I think you have been distracted by some of our advice. I think you should have spent more time reading the basic docco, the man pages and bit googling. (Don't expect the first expression you search for to be the right one.) -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-04-25 07:15 AM, Admin Beckspaced wrote:
Is it really that difficult? I'm more that grateful for any insight.
No, it's not that difficult, /etc/hosts works. I used it for years, even when I was running a DNS server. With that DNS server, I added the hosts to that file and DNSMasq used it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-04-25 08:46 AM, James Knott wrote:
On 2020-04-25 07:15 AM, Admin Beckspaced wrote:
Is it really that difficult? I'm more that grateful for any insight.
No, it's not that difficult, /etc/hosts works. I used it for years, even when I was running a DNS server. With that DNS server, I added the hosts to that file and DNSMasq used it.
I just checked my current firewall, pfSense. I see it also uses /etc/hosts for host lookup. In the *nix world, /etc/hosts is the standard location for host name lookup. I have never seen anything else. On the other hand, in Windows, you have to be careful you find the right file as there are a couple of others that look right, but aren't. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 25/04/2020 08:46, James Knott wrote:
On 2020-04-25 07:15 AM, Admin Beckspaced wrote:
Is it really that difficult? I'm more that grateful for any insight.
No, it's not that difficult, /etc/hosts works. I used it for years, even when I was running a DNS server. With that DNS server, I added the hosts to that file and DNSMasq used it.
On reboot, restart or SIGHUP When it receives a SIGHUP, dnsmasq clears its cache and then re-loads /etc/hosts and /etc/ethers and any file given by --dhcp-hostsfile, --dhcp-hostsdir, --dhcp-opts-file, --dhcp-optsdir, --addn-hosts or --hostsdir. The dhcp lease change script is called for all existing DHCP leases. If --no-poll is set SIGHUP also re-reads /etc/resolv.conf. That's from the DNSMASQ man page. If you're not running DNSMasq then things might be very different for you. You can, I believe, set up BIND to not use /etc/hosts by judicious use of /etc/resolve.conf -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 25/04/2020 13.15, Admin Beckspaced wrote:
Dear opensuse users,
I'm running the latest opensuse leap 15.1
just today I ran into a situation where I needed to point a domain to a specific IP adress.
A domain or a host?
If I'm on my windows client I just update the hosts file
112.202.123.179 somedomain.com
Because in Linux parlance that's a host. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
participants (8)
-
Admin Beckspaced
-
Anton Aylward
-
Carlos E. R.
-
Dave Howorth
-
James Knott
-
Patrick Shanahan
-
Per Jessen
-
Ruben Safir