Re: 1 line null webserver
by Ted Roche
On Sat, Dec 3, 2022 at 4:41 PM Mike Wright <nobody(a)nospam.hostisimo.com> wrote:
>
> Anybody have a nc one-liner or other alternative that would accomplish this?
>
Some of my best projects started out as a one-liner. ;)
I'm using Pihole now. It acts as a DNS and returns 0.0.0.0 as the
address . What if you set dnsmasq to do this with no web server
needed?
1 year, 5 months
Re: 1 line null webserver
by Philip Rhoades
Mike,
ruby -run -e httpd . -p 5000
P.
On 2022-12-04 21:01, Barry wrote:
>> On 3 Dec 2022, at 21:40, Mike Wright <nobody(a)nospam.hostisimo.com>
>> wrote:
>>
>> Hi all,
>>
>> I'm using dnsmasq to create an ad/media blocker. Whenever it receives
>> a request for any listed domain I want to return a specific IP that
>> points to a dummy webserver. That part works.
>>
>> It's the dummy webserver that has me stumped. I'd like it to return 0
>> bytes, status 200 for every connection to port 80.
>>
>> nc seems like a good candidate but I can't get it right.
>>
>> Anybody have a nc one-liner or other alternative that would accomplish
>> this?
>
> I Use apache httpd, its very low over head to serve static content.
> From memory I recall it used approx. 100k bytes of memory.
>
> Barry
>>
>> Thanks for any ideas,
>> Mike Wright
>> _______________________________________________
>> users mailing list -- users(a)lists.fedoraproject.org
>> To unsubscribe send an email to users-leave(a)lists.fedoraproject.org
>> Fedora Code of Conduct:
>> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>> List Guidelines:
>> https://fedoraproject.org/wiki/Mailing_list_guidelines
>> List Archives:
>> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
>> Do not reply to spam, report it:
>> https://pagure.io/fedora-infrastructure/new_issue
> _______________________________________________
> users mailing list -- users(a)lists.fedoraproject.org
> To unsubscribe send an email to users-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
> Do not reply to spam, report it:
> https://pagure.io/fedora-infrastructure/new_issue
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil(a)pricom.com.au
1 year, 5 months
Re: 1 line null webserver
by Tim
On Sat, 2022-12-03 at 13:40 -0800, Mike Wright wrote:
> I'm using dnsmasq to create an ad/media blocker. Whenever it receives a
> request for any listed domain I want to return a specific IP that points
> to a dummy webserver. That part works.
>
> It's the dummy webserver that has me stumped. I'd like it to return 0
> bytes, status 200 for every connection to port 80.
I took the approach (using BIND) to return a null result (domain
doesn't exist) for banned advert sources.
--
uname -rsvp
Linux 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
Boilerplate: All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
1 year, 5 months
1 line null webserver
by Mike Wright
Hi all,
I'm using dnsmasq to create an ad/media blocker. Whenever it receives a
request for any listed domain I want to return a specific IP that points
to a dummy webserver. That part works.
It's the dummy webserver that has me stumped. I'd like it to return 0
bytes, status 200 for every connection to port 80.
nc seems like a good candidate but I can't get it right.
Anybody have a nc one-liner or other alternative that would accomplish this?
Thanks for any ideas,
Mike Wright
1 year, 5 months
Re: ssh impacted by systemd.resolved
by Petr Menšík
systemd-resolved can also be just uninstalled. Provides at least very
basic symlink removal.
On 4/19/22 14:27, Tom Horsley wrote:
> On Mon, 18 Apr 2022 23:43:36 -0400
> Sam Varshavchik wrote:
>
>> Help me out here: wasn't there a point of order made, way back when: hey, if
>> you want to disable systemd-resolved, just manually replace the
>> /etc/resolv.conf symlink?
> You also need to systemctl disable systemd-resolved (and probably
> systemctl mask systemd-resolved). That way it doesn't update anything
> at all. That's how I'm currently set and everyone is happily using
> the dnsmasq I have installed to serve my local lan.
I think the major problem is with upgrades from previous versions of
Fedora, where nothing similar were required. systemd-resolved just
grabbed /etc/resolv.conf and made many other dhcp clients unable to get
it back. They also don't offer simple way to disable resolved and keep
DNS working.
>
> Systemd didn't invent replacing resolv.conf, various dhcp client
> shofware have done that for years (and it was just as irritating when
> they did it).
systemd invented replacing /etc/resolv.conf with symlink leading to a
private /run directory. No other software did that automatically AFAIK.
If you disable systemd-resolved later, it would stay broken. Other
clients just overwritten the contents of /etc/resolv.conf. A common
trick is using chattr +i /etc/resolv.conf when you want to prevent
random rewrites.
When it should reconfigure system name resolution, it has to use some
way. Current resolvconf from systemd-resolved package is useless without
systemd-resolved enabled. I don't know about any better generic
interface to configure system nameservers.
--
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemensik(a)redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
2 years
Re: ssh impacted by systemd.resolved
by Tom Horsley
On Mon, 18 Apr 2022 23:43:36 -0400
Sam Varshavchik wrote:
> Help me out here: wasn't there a point of order made, way back when: hey, if
> you want to disable systemd-resolved, just manually replace the
> /etc/resolv.conf symlink?
You also need to systemctl disable systemd-resolved (and probably
systemctl mask systemd-resolved). That way it doesn't update anything
at all. That's how I'm currently set and everyone is happily using
the dnsmasq I have installed to serve my local lan.
Systemd didn't invent replacing resolv.conf, various dhcp client
shofware have done that for years (and it was just as irritating when
they did it).
2 years
Re: Help configuring internal network
by Patrick O'Callaghan
On Sun, 2022-03-20 at 08:50 -0400, Jonathan Billings wrote:
> On Mar 20, 2022, at 04:17, Tim via users
> <users(a)lists.fedoraproject.org> wrote:
> >
> > When has the /etc/hosts file ever given anything an IP address?
>
> I don’t know the exact details of this particular problem, but if you
> install the “dnsmasq” package, it includes dns and dhcp service, and
> by default it parses /etc/hosts and uses it for DNS names.
I think Tim's point is that the /etc/hosts file doesn't *assign* IP
addresses, it merely *records* them.
poc
2 years, 1 month
Re: Help configuring internal network
by Jonathan Billings
On Mar 20, 2022, at 04:17, Tim via users <users(a)lists.fedoraproject.org> wrote:
>
> When has the /etc/hosts file ever given anything an IP address?
I don’t know the exact details of this particular problem, but if you install the “dnsmasq” package, it includes dns and dhcp service, and by default it parses /etc/hosts and uses it for DNS names.
https://thekelleys.org.uk/dnsmasq/doc.html
—
Jonathan Billings
2 years, 1 month
Re: How to get Fedora 35 to use DNS name as hostname?
by Peter Boy
> Am 26.01.2022 um 23:48 schrieb Samuel Sieb <samuel(a)sieb.net>:
>
> The DCHP server is the one that's supposed to be supplying the hostname.
Yes, indeed. In my test setup here, I use dnsmasq (as libvirt plugin) and find in /var/lib/libvirt/dnsmasq/virbr0.macs entries like:
{
"domain": "vm1",
"macs": [
"52:54:00:37:f5:03"
]
}
And optionally I can define vor each name an IP address (either in virsh net-edit default or in default.addhost) that the DHCP picks up.
And in virbr0.status more detailed what is answered to the DHCP request:
{
"ip-address": "192.168.122.207",
"mac-address": "52:54:00:e9:43:0c",
"hostname": "vm2",
"client-id": "01:52:54:00:e9:43:0c",
"expiry-time": 1643242158
}
But as soon as you make the hostname static on the client, you can configure in dnsmasq as hostname what you like, the client does not change the hostname.
So, Thomas should check with dhclient -v (out of my head, maybe some more parameters, there is also a dry-run, that doesn’t change configuration) what his DHCP delivers.
And in any case better keep away from messing around with /etc/hostname.
Best
Peter
2 years, 3 months