PHPackages                             geeklab/localname - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. geeklab/localname

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

geeklab/localname
=================

Look up names for ips using mDNS/Netbios/etc.

V1.1.0(3d ago)08BSD-4-ClausePHP &gt;=8.1

Since Jul 7Compare

[ Source](https://github.com/ellisgl/localname)[ Packagist](https://packagist.org/packages/geeklab/localname)[ RSS](/packages/geeklab-localname/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

LocalName
=========

[](#localname)

Resolve hostnames on local networks via mDNS, LLMNR, NetBIOS, and reverse DNS. Includes ARP-based MAC address lookup with IEEE OUI vendor identification.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- `ext-sockets`

Installation
------------

[](#installation)

```
composer require geeklab/localname
```

Then download the IEEE OUI database for MAC vendor lookups:

```
vendor/bin/update-oui.php data/oui.csv
```

Quick Start
-----------

[](#quick-start)

```
use Geeklab\Localname\LocalName;

$resolver = LocalName::create(__DIR__ . '/data/oui.csv');
$result   = $resolver->lookup('192.168.1.100');

echo $result->ip;       // 192.168.1.100
echo $result->name;     // my-laptop.local
echo $result->protocol; // mdns
echo $result->mac;      // AA:BB:CC:DD:EE:FF
echo $result->vendor;   // Apple, Inc.
```

Resolvers
---------

[](#resolvers)

`LocalName::create()` tries each resolver in order and returns the first match:

ResolverProtocolMethodmDNSMulticast DNS (224.0.0.251:5353)PTR queryNetBIOSNBSTAT (port 137)Wildcard name queryLLMNRLink-Local Multicast (224.0.0.252:5355)PTR queryReverse DNSSystem DNS`gethostbyaddr()`### Using Individual Resolvers

[](#using-individual-resolvers)

```
use Geeklab\Localname\Resolvers\Mdns;
use Geeklab\Localname\Resolvers\Netbios;
use Geeklab\Localname\Resolvers\Llmnr;
use Geeklab\Localname\Resolvers\ReverseDns;

$mdns = new Mdns(timeout: 3.0);
$name = $mdns->resolve('192.168.1.100'); // returns string or null
```

### Getting All Results

[](#getting-all-results)

```
$results = $resolver->lookupAll('192.168.1.100');

foreach ($results as $r) {
    printf("[%s] %s\n", $r->protocol, $r->name);
}
```

MAC Vendor Lookup
-----------------

[](#mac-vendor-lookup)

MAC vendor identification requires the IEEE OUI database. Download it with the included script:

```
vendor/bin/update-oui.php data/oui.csv
```

This downloads the IEEE OUI database to the path you specify. Without it, `lookup()` still works -- `vendor` will just be `null`.

Then pass the path when creating the resolver:

```
$resolver = LocalName::create(__DIR__ . '/data/oui.csv');
```

Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

BSD-4-Clause

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance99

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/94559?v=4)[Ellis](/maintainers/ellisgl)[@ellisgl](https://github.com/ellisgl)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geeklab-localname/health.svg)

```
[![Health](https://phpackages.com/badges/geeklab-localname/health.svg)](https://phpackages.com/packages/geeklab-localname)
```

###  Alternatives

[verbb/tablemaker

Create customizable and user-defined table fields.

40176.8k2](/packages/verbb-tablemaker)[symfony/ux-typed

Typed integration for Symfony

11148.4k2](/packages/symfony-ux-typed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
